From ad6987377f158cd4a5f3499b4ce488819c8e13b1 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 21 May 2024 12:45:50 +0530 Subject: [PATCH] fix: text to select conversion (#8536) Co-authored-by: mertmit --- packages/nocodb/src/services/columns.service.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/services/columns.service.ts b/packages/nocodb/src/services/columns.service.ts index a471021c9b..f2e56b8119 100644 --- a/packages/nocodb/src/services/columns.service.ts +++ b/packages/nocodb/src/services/columns.service.ts @@ -452,10 +452,16 @@ export class ColumnsService { }), ); - const data = await sqlClient.raw('SELECT DISTINCT ?? FROM ??', [ - column.column_name, - baseModel.getTnPath(table.table_name), - ]); + const data = await baseModel.execAndParse( + baseModel.dbDriver.raw('SELECT DISTINCT ?? FROM ??', [ + column.column_name, + baseModel.getTnPath(table.table_name), + ]), + null, + { + raw: true, + }, + ); if (data.length) { const existingOptions = colBody.colOptions.options.map(