feat: wire enable_realtime into DATABASE_SETTINGS_SQL COALESCE cascade#1129
Merged
pyramation merged 2 commits intomainfrom May 11, 2026
Merged
Conversation
Now that constructive-db#1105 is merged, the enable_realtime column exists in both database_settings and api_settings. Wire it into the COALESCE cascade so the resolved value flows through to the preset.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This comment has been minimized.
This comment has been minimized.
…i_settings The DATABASE_SETTINGS_SQL query now references enable_realtime via the COALESCE cascade. The integration test seed DDL was missing this column, causing the query to fail and all feature flags to fall back to defaults — which made Bob's restricted API expose uploadAppFile when it should have been hidden by the api_settings override.
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
Removes the hardcoded
enableRealtime: falseplaceholder and wiresenable_realtimeinto theDATABASE_SETTINGS_SQLCOALESCE cascade, following the same pattern as all other feature flags (enable_llm,enable_ltree, etc.).This is a follow-up to constructive-db#1105 (which added the
enable_realtimecolumn todatabase_settingsandapi_settings) and #1119 (which integratedRealtimeManagerinto the preset but hardcoded the flag tofalsebecause the column didn't exist yet).Three changes in
api.ts:COALESCE(aps.enable_realtime, ds.enable_realtime) AS resolved_enable_realtimeto the queryresolved_enable_realtime: booleantoDatabaseSettingsRowenableRealtime: falsewithenableRealtime: row.resolved_enable_realtimeintoDatabaseSettingsUpdates since last revision
Added
enable_realtimecolumn to the integration test seed DDL (simple-seed-services/setup.sql). Without this, theDATABASE_SETTINGS_SQLquery fails against the test database (column doesn't exist),queryDatabaseSettingscatches the error and returnsundefined, and all feature flags fall back to defaults — causing theBob restricted API: uploadAppFile NOT exposedtest to fail because theapi_settingsoverride forenable_presigned_uploadswas silently ignored.Review & Testing Checklist for Human
enable_realtimealready exists in bothservices_public.database_settingsandservices_public.api_settings. If constructive-db#1105 has not been deployed to an environment, theDATABASE_SETTINGS_SQLquery will fail. The failure is caught byqueryDatabaseSettings's try/catch (returnsundefined+ logs a warning), but this means all database settings become undefined for that tenant — not just realtime. Verify feat: add DataBillingMeter and DataAggregateLimitCounter node types #1105 is deployed before rolling this out.api_settings.enable_realtimeis nullable (NULL inherits fromdatabase_settings), whiledatabase_settings.enable_realtimeisNOT NULL DEFAULT false. Confirm COALESCE produces the right result: api-level override wins when non-null, otherwise falls back to database-level default.simple-seed-services/setup.sqlmanually mirrors the productiondatabase_settings/api_settingsschema. Any future column additions to these tables will need a corresponding update to the seed DDL, or the same silent-failure pattern will recur.Notes
enable_realtime = trueindatabase_settings(or per-API inapi_settings) will causeRealtimeManagerto start and theRealtimeSubscriptionsPresetto be included for that tenant.realtime_moduleto a test database and applyingDataRealtimeto a table (which automatically adds the@realtimesmart tag).Link to Devin session: https://app.devin.ai/sessions/19485cf5cc58416a9f86068563d512f5
Requested by: @pyramation