in src/lib/db.ts [10:25]
export function createDatabaseConnectionPool(dbConfig: DBConfig): Pool {
const match = /\/\/(.*)\/(.*)/.exec(dbConfig.url);
if (match !== null) {
const [, host, database] = match;
return new Pool({
host,
database,
user: dbConfig.username,
password: dbConfig.password,
port: 5432,
});
}
throw new Error(`Could not parse DB config ${JSON.stringify(dbConfig)}`);
}