Skip to content

Fix railsmaster CI with pglite 0.1.1 compatibility shim#63

Open
MattyMc wants to merge 1 commit into
palkan:masterfrom
MattyMc:fix-pglite-rails-main-compat
Open

Fix railsmaster CI with pglite 0.1.1 compatibility shim#63
MattyMc wants to merge 1 commit into
palkan:masterfrom
MattyMc:fix-pglite-rails-main-compat

Conversation

@MattyMc

@MattyMc MattyMc commented Jun 5, 2026

Copy link
Copy Markdown

pglite 0.1.1 is missing a few PG-compatible connection APIs that Rails main now calls during connection setup. It also returns nil for parameter_status("TimeZone"), which causes Rails to send a session time zone SET statement that crashes the wasm instance.

This PR adds a small compatibility shim for pglite 0.1.1 so the railsmaster CI job can run until pglite releases native support for these APIs.

Fixes #62

What is the purpose of this pull request?

Fix the railsmaster CI job when running against pglite 0.1.1.

What changes did you make? (overview)

Added a version-pinned compatibility patch for pglite <= 0.1.1 that:

  • defines PG::CONNECTION_OK if missing
  • adds PGlite::Connection#close
  • makes #finished? report the connection as open
  • adds #status
  • returns "UTC" for parameter_status("TimeZone") so Rails does not send a time zone SET

The patch is intentionally scoped to pglite <= 0.1.1 so it should retire once pglite ships the missing compatibility methods.

Is there anything you'd like reviewers to focus on?

The main thing to review is whether spec_helper.rb is the right place for this temporary shim. It needs to run before any support files trigger database access.

Checklist

  • I've added tests for this change. Test already exists, the CI pipeline fail
  • I've added a Changelog entry
  • I've updated a documentation (Readme). N/A

pglite 0.1.1 is missing the connection methods Rails main now calls (close, finished?, status) and answers nil to parameter_status, which makes Rails send a session timezone SET that crashes the wasm build. Shim the connection until a pglite release covers it.
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.

pglite is incompatible with Rails main connection setup, causing railsmaster CI failures

1 participant