Skip to content

Commit 25144ae

Browse files
authored
Merge pull request #816 from constructive-io/devin/1773532496-schema-naming-pgsettings
feat: pass schema naming strategy env vars to pgSettings
2 parents 64ef59e + 0ef5f37 commit 25144ae

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

graphql/server/src/middleware/graphile.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,15 @@ const buildPreset = (
151151
const req = (requestContext as { expressv4?: { req?: Request } })?.expressv4?.req;
152152
const context: Record<string, string> = {};
153153

154+
// Schema naming strategy settings (for local development).
155+
// See constructive-db: get_available_schema_hash / create_schema_trigger.
156+
if (process.env.CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES) {
157+
context['constructive.simple_schema_names'] = process.env.CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES;
158+
}
159+
if (process.env.CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES) {
160+
context['constructive.schema_use_underscores'] = process.env.CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES;
161+
}
162+
154163
if (req) {
155164
if (req.databaseId) {
156165
context['jwt.claims.database_id'] = req.databaseId;

0 commit comments

Comments
 (0)