Implement persistent typed database environments - #5887
Merged
Merged
Conversation
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
This was referenced Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 8, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
cloutiertyler
commented
Sep 9, 2026
bfops
reviewed
Sep 12, 2026
cloutiertyler
commented
Sep 13, 2026
cloutiertyler
commented
Sep 13, 2026
cloutiertyler
commented
Sep 13, 2026
cloutiertyler
commented
Sep 13, 2026
cloutiertyler
commented
Sep 13, 2026
cloutiertyler
commented
Sep 14, 2026
cloutiertyler
left a comment
Contributor
Author
There was a problem hiding this comment.
I've really spent quite a while reviewing and testing this PR. I believe it's good to go, but this is still quite high risk, especially with changes to the control db and the host/module lifecycle.
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.
Description of Changes
Implements typed environment variables with typed module accessors, persistent values, and a usage guide. Supports undeclared values,
--env-only, explicit deletion, and--replace-env. Updates use module-publishing permissions and validate atomically against module declarations.Creation and reset persist initial values before starting the replica. Rejected publishes preserve the running host; unchanged publishes remain no-ops. Cloud companion: SpacetimeDBPrivate#3940.
API and ABI breaking changes
Not breaking. Requires a minor version bump.
Extends V10 metadata and host imports. Extends the HTTP API to allow publishing environment variables when publishing a module. ENV-enabled modules require an updated host.
Rollback safety impact
n/a (no prerequisite PRs). Older hosts cannot run ENV-enabled modules. Standalone control DB row encodings are unchanged; re-upgrading ignores obsolete initial values left by an older server's reset.
--delete-dataclears environment values.Expected complexity level and risk
4/5. Publication, persistence, secret access controls, and all four module libraries.
Testing
CLI smoke tests and module tests cover typed access, authorization, atomic updates, rejected publication, unchanged-publication no-ops, view refresh, restart/recovery, and legacy control DB reset compatibility.