This commit is contained in:
2026-01-04 20:58:47 +09:00
parent a87c11597a
commit 0660ed3973
37 changed files with 1723 additions and 885 deletions

View File

@@ -9,14 +9,12 @@ let pool: pg.Pool | null = null
*/
export function getPool(): pg.Pool {
if (!pool) {
const config = useRuntimeConfig()
const poolConfig = {
host: config.dbHost,
port: parseInt(config.dbPort as string),
database: config.dbName,
user: config.dbUser,
password: config.dbPassword,
host: process.env.DB_HOST || 'localhost',
port: parseInt(process.env.DB_PORT || '5432'),
database: process.env.DB_NAME || 'weeklyreport',
user: process.env.DB_USER || 'postgres',
password: process.env.DB_PASSWORD || '',
max: 10,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000,