File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ DATABASE_URL=postgresql://postgres:devpassword@localhost:5432/typelets_local
1717# For production (example):
1818# DATABASE_URL=postgresql://username:password@hostname:5432/database?sslmode=require
1919
20+ # Database Connection Pooling (OPTIONAL)
21+ # DB_POOL_MAX=20 # Maximum connections in pool (default: 20)
22+ # DB_IDLE_TIMEOUT=20 # Close idle connections after N seconds (default: 20)
23+ # DB_CONNECT_TIMEOUT=10 # Connection timeout in seconds (default: 10)
24+
2025# Clerk Authentication (REQUIRED)
2126# Get your secret key from: https://dashboard.clerk.com/
2227# For development, use test keys (sk_test_...)
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ if (!process.env.DATABASE_URL) {
99
1010const client = postgres . default ( process . env . DATABASE_URL , {
1111 ssl : process . env . NODE_ENV === "production" ? "require" : false ,
12+ max : process . env . DB_POOL_MAX ? parseInt ( process . env . DB_POOL_MAX ) : 20 ,
13+ idle_timeout : process . env . DB_IDLE_TIMEOUT ? parseInt ( process . env . DB_IDLE_TIMEOUT ) : 20 ,
14+ connect_timeout : process . env . DB_CONNECT_TIMEOUT ? parseInt ( process . env . DB_CONNECT_TIMEOUT ) : 10 ,
1215} ) ;
1316
1417export const db = drizzle ( client , { schema } ) ;
You can’t perform that action at this time.
0 commit comments