Skip to content

Commit 27a30e7

Browse files
committed
ensure lowercased statements
1 parent b420b75 commit 27a30e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -477,13 +477,13 @@ async function getQueryTypes(query: string): Promise<string[]> {
477477

478478
async function executeQuery<T>(
479479
sql: string,
480-
params: any[] = [],
480+
params: string[] = [],
481481
): Promise<T> {
482482
let connection
483483
try {
484484
const pool = await getPool()
485485
connection = await pool.getConnection()
486-
const result = await connection.query(sql, params)
486+
const result = await connection.query(sql.toLocaleLowerCase(), params)
487487
return (Array.isArray(result) ? result[0] : result) as T
488488
} catch (error) {
489489
log('error', 'Error executing query:', error)
@@ -599,7 +599,7 @@ async function executeReadOnlyQuery<T>(sql: string): Promise<T> {
599599

600600
try {
601601
// Execute query - in multi-DB mode, we may need to handle USE statements specially
602-
const result = await connection.query(sql)
602+
const result = await connection.query(sql.toLocaleLowerCase())
603603
const rows = Array.isArray(result) ? result[0] : result
604604

605605
// Rollback transaction (since it's read-only)
@@ -660,7 +660,7 @@ async function executeWriteQuery<T>(sql: string): Promise<T> {
660660

661661
try {
662662
// @INFO: Execute the write query
663-
const result = await connection.query(sql)
663+
const result = await connection.query(sql.toLocaleLowerCase())
664664
const response = Array.isArray(result) ? result[0] : result
665665

666666
// @INFO: Commit the transaction

0 commit comments

Comments
 (0)