Skip to content

Commit

Permalink
improve logged message execute SQL commands
Browse files Browse the repository at this point in the history
  • Loading branch information
fredzqm committed May 10, 2024
1 parent d2e1172 commit 281a205
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gcp/cloudsql/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function execute(
const connectionName = instance.connectionName;
if (!connectionName) {
throw new FirebaseError(
`Could not get instance conection string for ${opts.instanceId}:${opts.databaseId}`,
`Could not get instance connection string for ${opts.instanceId}:${opts.databaseId}`,
);
}
let connector: Connector;
Expand Down Expand Up @@ -70,7 +70,7 @@ export async function execute(
break;
}
default: {
// cSQL doesn't return user.type for BUILT_IN users...
// Cloud SQL doesn't return user.type for BUILT_IN users...
if (!opts.password) {
throw new FirebaseError(`Cannot connect as BUILT_IN user without a password.`);
}
Expand All @@ -92,8 +92,9 @@ export async function execute(
}
}

logFn(`Logged in as ${opts.username}`);
for (const s of sqlStatements) {
logFn(`Executing: '${s}' as ${opts.username}`);
logFn(`Executing: '${s}'`);
try {
await pool.query(s);
} catch (err) {
Expand Down

0 comments on commit 281a205

Please sign in to comment.