Skip to content

Commit

Permalink
fix(db/pool): don't manually fetch connection
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Oct 15, 2024
1 parent 31de350 commit 2efda9f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/database/pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export async function createConnectionPool() {
connection.query(mysql_transaction_isolation_level);
});

using conn = await getConnection();

const result = (await conn.query('SELECT VERSION() as version')) as RowDataPacket[];
const [result] = (await dbPool.query('SELECT VERSION() as version')) as RowDataPacket[];
dbVersion = `^5[${result[0].version}]`;

console.log(`${dbVersion} ^2Database server connection established!^0`);
Expand Down

0 comments on commit 2efda9f

Please sign in to comment.