Add startup postgresConfig and WAL-compatible pgoutput support#897
Open
sorenbs wants to merge 1 commit intoelectric-sql:mainfrom
Open
Add startup postgresConfig and WAL-compatible pgoutput support#897sorenbs wants to merge 1 commit intoelectric-sql:mainfrom
sorenbs wants to merge 1 commit intoelectric-sql:mainfrom
Conversation
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.
Summary
This PR enables reliable logical WAL support for
@electric-sql/pgliteconsumers (specificallyppg-dev) by adding startup-time Postgres config support and wiring pgoutput-compatible symbol exports.ppg-devdepends on setting postmaster-level GUCs at startup (wal_level=logical, replication slot/sender limits), and on loadingpgoutputfor logical decoding. This PR makes that work end-to-end.Changes
PGliteOptions.postgresConfig?: Record<string, string | number | boolean>PGLITE_POSTGRES_CONFIG.postgres-pglitesubmodule):PGLITE_POSTGRES_CONFIG.SetConfigOption(..., PGC_POSTMASTER, PGC_S_ARGV)before normal startup proceeds in both startup paths.included.pglite.importsso the main wasm exports whatpgoutput.soneeds at load time.Infinitysentinel on close (emscripten shutdown anomaly path) so close remains successful.packages/pglite/tests/postgres-config.test.tsverifies startup application of:wal_level=logicalmax_replication_slotsmax_wal_sendersValidation
vitest tests/postgres-config.test.ts tests/basic.test.ts --runpass.pg_create_logical_replication_slot(..., 'pgoutput')succeeds.pg_logical_slot_get_binary_changes(...)returns changes.dev/server/src/db.wal.test.ts.Dependency
This PR depends on the corresponding
prisma/postgres-pglitebranch/PR that contains the wasm/backend symbol-export and startup-config plumbing. electric-sql/postgres-pglite#64