We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c712ce0 commit d29245eCopy full SHA for d29245e
packages/backend/src/scripts/execsql.ts
@@ -10,8 +10,11 @@ export async function runSQLFile(filePath: string) {
10
try {
11
await client.connect();
12
const sql = await readFile(filePath, { encoding: 'utf8' });
13
- await client.query(sql);
14
- console.log(`Executed SQL file: ${filePath}`);
+ console.log(`Executing SQL file: ${filePath}.\n${sql}`);
+ const result = await client.query(sql);
15
+ console.log(
16
+ `rowcount:${result.rowCount}\n${JSON.stringify(result.rows, null, 2)}`,
17
+ );
18
} catch (err) {
19
console.error(`Error executing SQL file ${filePath}:`, err);
20
} finally {
0 commit comments