Skip to content

Set up Streamgres schema at startup - #29

Open
a-guhan wants to merge 4 commits into
mainfrom
feat/streamgres-schema
Open

a-guhan wants to merge 4 commits into
mainfrom
feat/streamgres-schema

Conversation

@a-guhan

@a-guhan a-guhan commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Streamgres required manual provisioning of its mutation schema, publication, and DDL event triggers. That made deployments fragile and allowed configuration to drift.

Changes:

Startup now creates missing objects and validates existing ones without silently rewriting mismatches. Schema snapshots are compared structurally while preserving primary-key and index-column order.

Environment changes:

Set STREAMGRES_MASTER_PG_DSN to a writable primary, STREAMGRES_APP_ID=streamgres, STREAMGRES_SHARD=0, STREAMGRES_SCHEMAS=public,streamgres_0, and STREAMGRES_PUBLICATION=streamgres_sync_pub. Keep STREAMGRES_PG_DSN for the feed. Remove STREAMGRES_DDL_TRIGGER and STREAMGRES_DDL_PREFIX; they’re derived from the app ID and shard.

Comment thread src/bin/bench.rs

let mut message = XY_CHANNELS * XY_CONVERSATIONS_PER_CHANNEL * XY_MESSAGES_PER_CONVERSATION;
let mut inserts = Vec::with_capacity(XY_MESSAGE_INSERTS);
for _ in 0..XY_MESSAGE_INSERTS {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a clippy warning cleanup

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.

1 participant