8000 fix(engine): reach the server's extension as reylo, reading its jsonb by colinhacks · Pull Request #140 · colinhacks/reylo · GitHub
[go: up one dir, main page]

Skip to content

fix(engine): reach the server's extension as reylo, reading its jsonb - #140

Merged
colinhacks merged 2 commits into
mainfrom
extension-reylo
Oct 28, 2026
Merged

colinhacks merged 2 commits into
mainfrom
extension-reylo

Conversation

@colinhacks
Copy link
Copy Markdown
Owner

Two changes to how the Postgres engine talks to the server-side extension that hosts it inside Postgres.

  • The extension's name and schema are reylo. The client's handshake (engine/postgres/src/extension.rs) probes pg_extension for reylo and calls reylo.version(), reylo.analyze() and reylo.answer(). The catalog-query check allows that schema's calls, and the doc comments name the extension by it.
  • A json or jsonb catalog 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 answer jsonb, so a database with the extension installed ended every analysis in that panic. tokio-postgres's with-serde_json-1 feature now reads such a column.

Checks

  • tests/connect.test.ts gains a test that reads a jsonb, a json and a null jsonb column through an engine connection. It panics without the fix.
  • cargo test of every engine crate, and cargo build --workspace --all-targets with no warning.
  • engine/build.sh, which rebuilds all three components, since core and the facade changed.
  • nub run typecheck and nub run test against Postgres 18.

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.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 16:43
@vercel
vercel Bot commented Oct 28, 2026 •
Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
reylo Ready Ready Preview Oct 28, 2026 4:46pm UTC

Request Review

Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@pullfrog pullfrog Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 pgreylo to reylo: these now use reylo: the probe of pg_extension, the reylo.version(), reylo.analyze() and reylo.answer() queries, the schema allowlist in catalog_queries.rs, and every doc comment. No pgreylo is left anywhere in the repo. A server that still has only the old extension installed is now treated as Server::Absent. The client falls back to answering every need itself, so an old install causes no error.
  • json/jsonb cells read as values: cell() in engine/facade/src/clients/tokio_postgres.rs now reads both types as serde_json::Value through tokio-postgres's with-serde_json-1 feature. Before, these columns hit the panic arm. This fits extension.rs::json_value, which already accepts a parsed value as well as text. A null jsonb maps to Value::Null, as the new test checks.
  • Rebuilt artifacts: both Cargo.lock files and all three committed components were updated. A core change alters every engine's fingerprint, so all three needed rebuilding.
  • Test: tests/connect.test.ts reads jsonb, json and a null jsonb through an engine connection.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@colinhacks
colinhacks merged commit 51e7206 into main Oct 28, 2026
11 checks passed
@colinhacks
colinhacks deleted the extension-reylo branch October 28, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0