mirror of
https://github.com/sergeyyarkov/node-docker-example.git
synced 2026-10-11 02:09:22 +03:00
16 lines
289 B
JavaScript
16 lines
289 B
JavaScript
import fs from 'node:fs';
|
|
import db from './db.js';
|
|
|
|
async function run() {
|
|
const { client } = db;
|
|
client.connect();
|
|
|
|
const query = fs.readFileSync('sql/schema_init.sql').toString();
|
|
|
|
await client.query(query);
|
|
console.log(`SQL: ${query}`);
|
|
await client.end();
|
|
}
|
|
|
|
await run();
|