diff options
| author | Dax Raad <[email protected]> | 2025-08-28 17:33:52 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-08-28 17:33:52 -0400 |
| commit | 3fa02623c3a4cd9bc80cd42f6a18164350547581 (patch) | |
| tree | a0027a56dc3b67c3f753fa42c3998d03efbb2964 /cloud | |
| parent | 403f9b2f1b153deefcce71923664498b8903fda5 (diff) | |
| download | opencode-3fa02623c3a4cd9bc80cd42f6a18164350547581.tar.gz opencode-3fa02623c3a4cd9bc80cd42f6a18164350547581.zip | |
ignore: cloud
Diffstat (limited to 'cloud')
| -rw-r--r-- | cloud/core/src/drizzle/index.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloud/core/src/drizzle/index.ts b/cloud/core/src/drizzle/index.ts index 1d448bbe0..bbf3f4cd7 100644 --- a/cloud/core/src/drizzle/index.ts +++ b/cloud/core/src/drizzle/index.ts @@ -3,7 +3,7 @@ import { Resource } from "sst" export * from "drizzle-orm" import postgres from "postgres" -const createClient = () => { +const init = () => { const client = postgres({ idle_timeout: 30000, connect_timeout: 30000, @@ -20,6 +20,8 @@ const createClient = () => { return drizzle(client, {}) } +const createClient = "NODE_ENV" in process.env ? init : memo(init) + import { PgTransaction, type PgTransactionConfig } from "drizzle-orm/pg-core" import type { ExtractTablesWithRelations } from "drizzle-orm" import type { PostgresJsQueryResultHKT } from "drizzle-orm/postgres-js" |
