Repository navigation
fix(engine): reach the server's extension as reylo, reading its jsonb - #140
Merged
Merged
Conversation
The client's handshake probes for an extension named reylo and calls reylo.version, reylo.analyze and reylo.answer, the name and schema the extension takes. The catalog-query check allows that schema's calls.
The Postgres client panicked on any column type it does not list, and the server-side extension answers its version, a whole analysis and a round's needs as jsonb, so a database with the extension installed ended every analysis in that panic.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
I reviewed both commits: the extension's rename and the tokio-postgres client's handling of json and jsonb columns.
- Extension renamed from
pgreylotoreylo: these now usereylo: the probe ofpg_extension, thereylo.version(),reylo.analyze()andreylo.answer()queries, the schema allowlist incatalog_queries.rs, and every doc comment. Nopgreylois left anywhere in the repo. A server that still has only the old extension installed is now treated asServer::Absent. The client falls back to answering every need itself, so an old install causes no error. json/jsonbcells read as values:cell()inengine/facade/src/clients/tokio_postgres.rsnow reads both types asserde_json::Valuethrough tokio-postgres'swith-serde_json-1feature. Before, these columns hit the panic arm. This fitsextension.rs::json_value, which already accepts a parsed value as well as text. A nulljsonbmaps toValue::Null, as the new test checks.- Rebuilt artifacts: both
Cargo.lockfiles and all three committed components were updated. A core change alters every engine's fingerprint, so all three needed rebuilding. - Test:
tests/connect.test.tsreadsjsonb,jsonand a nulljsonbthrough an engine connection.
claude-opus-5-5 | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Two changes to how the Postgres engine talks to the server-side extension that hosts it inside Postgres.
reylo. The client's handshake (engine/postgres/src/extension.rs) probespg_extensionforreyloand callsreylo.version(),reylo.analyze()andreylo.answer(). The catalog-query check allows that schema's calls, and the doc comments name the extension by it.jsonorjsonbcatalog column reads as its value. The tokio-postgres client the engine's program answers with (engine/facade/src/clients/tokio_postgres.rs) panicked on any column type it does not list. Since each engine connects itself (feat(engine)!: let each engine connect itself as a wasip2 component #130), the handshake's queries go through it, and all three answerjsonb, so a database with the extension installed ended every analysis in that panic. tokio-postgres'swith-serde_json-1feature now reads such a column.Checks
tests/connect.test.tsgains a test that reads ajsonb, ajsonand a nulljsonbcolumn through an engine connection. It panics without the fix.cargo testof every engine crate, andcargo build --workspace --all-targetswith no warning.engine/build.sh, which rebuilds all three components, since core and the facade changed.nub run typecheckandnub run testagainst Postgres 18.