Some checks failed
Test and deploy staging / staging (push) Failing after 2m50s
11 lines
318 B
TypeScript
11 lines
318 B
TypeScript
import postgres from 'postgres';
|
|
|
|
if (!process.env.DB_URL) throw new Error('DB_URL is required');
|
|
const client = postgres(process.env.DB_URL, { max: 1 });
|
|
try {
|
|
const [row] = await client`select current_setting('server_version_num')::integer as version`;
|
|
console.log(row.version);
|
|
} finally {
|
|
await client.end();
|
|
}
|