Skip to content

Commit 9a2b5e5

Browse files
committed
Use custom replication stream ID and pool size
1 parent 0ef4711 commit 9a2b5e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sst.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default $config({
3737
// Add schema hash to db name to blow up on schema changes
3838
const schemaHash = getFileChecksum(schemaFile, 10);
3939
const dbName = `${isProduction ? `ai-chat` : `ai-chat-${$app.stage}`}-${schemaHash}`;
40+
const replicationStreamId = `${$app.stage}_ai_chat`.replace(/-/g, `_`);
4041

4142
// Iniitalize a database
4243
let dbUrl: $util.Input<string>;
@@ -115,9 +116,12 @@ export default $config({
115116
retries: 6,
116117
},
117118
environment: {
118-
ELECTRIC_INSECURE: $jsonStringify(true),
119+
ELECTRIC_DB_POOL_SIZE: $jsonStringify(isProduction ? 20 : 5),
120+
ELECTRIC_REPLICATION_STREAM_ID: replicationStreamId,
119121
DATABASE_URL: dbUrl,
120122
ELECTRIC_QUERY_DATABASE_URL: pooledDbUrl,
123+
ELECTRIC_INSECURE: $jsonStringify(true),
124+
ELECTRIC_LOG_COLORS: $jsonStringify(false),
121125
},
122126
dev: {
123127
directory: `electric/packages/sync-service`,

0 commit comments

Comments
 (0)