File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -477,13 +477,13 @@ async function getQueryTypes(query: string): Promise<string[]> {
477
477
478
478
async function executeQuery < T > (
479
479
sql : string ,
480
- params : any [ ] = [ ] ,
480
+ params : string [ ] = [ ] ,
481
481
) : Promise < T > {
482
482
let connection
483
483
try {
484
484
const pool = await getPool ( )
485
485
connection = await pool . getConnection ( )
486
- const result = await connection . query ( sql , params )
486
+ const result = await connection . query ( sql . toLocaleLowerCase ( ) , params )
487
487
return ( Array . isArray ( result ) ? result [ 0 ] : result ) as T
488
488
} catch ( error ) {
489
489
log ( 'error' , 'Error executing query:' , error )
@@ -599,7 +599,7 @@ async function executeReadOnlyQuery<T>(sql: string): Promise<T> {
599
599
600
600
try {
601
601
// 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 ( ) )
603
603
const rows = Array . isArray ( result ) ? result [ 0 ] : result
604
604
605
605
// Rollback transaction (since it's read-only)
@@ -660,7 +660,7 @@ async function executeWriteQuery<T>(sql: string): Promise<T> {
660
660
661
661
try {
662
662
// @INFO : Execute the write query
663
- const result = await connection . query ( sql )
663
+ const result = await connection . query ( sql . toLocaleLowerCase ( ) )
664
664
const response = Array . isArray ( result ) ? result [ 0 ] : result
665
665
666
666
// @INFO : Commit the transaction
You can’t perform that action at this time.
0 commit comments