From 6002b191ff5d02f646321089ceb127c0c2af2d24 Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 5 Dec 2023 17:59:39 +0300 Subject: [PATCH] fix: binding for VitessClient Signed-off-by: mertmit --- packages/nocodb/src/db/sql-client/lib/mysql/VitessClient.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/db/sql-client/lib/mysql/VitessClient.ts b/packages/nocodb/src/db/sql-client/lib/mysql/VitessClient.ts index 2b3836e7fe..df37c2f13b 100644 --- a/packages/nocodb/src/db/sql-client/lib/mysql/VitessClient.ts +++ b/packages/nocodb/src/db/sql-client/lib/mysql/VitessClient.ts @@ -131,7 +131,8 @@ class Vitess extends MysqlClient { args.databaseName = this.connectionConfig.connection.database; const response = await this.sqlClient.raw( - `select *, table_name as tn from information_schema.columns where table_name = '${args.tn}' ORDER by ordinal_position`, + `select *, table_name as tn from information_schema.columns where table_name = ?? ORDER by ordinal_position`, + [args.tn], ); if (response.length === 2) { @@ -209,7 +210,8 @@ class Vitess extends MysqlClient { try { const response = await this.sqlClient.raw( - `select *, TABLE_NAME as tn from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = '${args.tn}' ORDER by ordinal_position;`, + `select *, TABLE_NAME as tn from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where TABLE_NAME = ? ORDER by ordinal_position;`, + [args.tn], ); if (response.length === 2) {