diff --git a/packages/nocodb/src/lib/meta/api/columnApis.ts b/packages/nocodb/src/lib/meta/api/columnApis.ts index d2cf932860..30751c9c48 100644 --- a/packages/nocodb/src/lib/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/meta/api/columnApis.ts @@ -655,9 +655,9 @@ export async function columnUpdate(req: Request, res: Response) { const base = await Base.get(table.base_id); - const dbDriver = NcConnectionMgrv2.get(base); + const sqlClient = await NcConnectionMgrv2.getSqlClient(base); - const sqlClientType = dbDriver.clientType(); + const sqlClientType = sqlClient.knex.clientType(); const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); diff --git a/packages/nocodb/src/lib/meta/api/tableApis.ts b/packages/nocodb/src/lib/meta/api/tableApis.ts index 7fe1f5e905..b47fa5e5e6 100644 --- a/packages/nocodb/src/lib/meta/api/tableApis.ts +++ b/packages/nocodb/src/lib/meta/api/tableApis.ts @@ -151,12 +151,8 @@ export async function tableCreate(req: Request, res) { const sqlClient = await NcConnectionMgrv2.getSqlClient(base); - const dbDriver = NcConnectionMgrv2.get(base); - - const sqlClientType = dbDriver.clientType(); - let tableNameLengthLimit = 255; - + const sqlClientType = sqlClient.knex.clientType(); if (sqlClientType === 'mysql2' || sqlClientType === 'mysql') { tableNameLengthLimit = 64; } else if (sqlClientType === 'pg') { @@ -313,7 +309,7 @@ export async function tableUpdate(req: Request, res) { const sqlClient = await NcConnectionMgrv2.getSqlClient(base); let tableNameLengthLimit = 255; - const sqlClientType = sqlClient.clientType; + const sqlClientType = sqlClient.knex.clientType(); if (sqlClientType === 'mysql2' || sqlClientType === 'mysql') { tableNameLengthLimit = 64; } else if (sqlClientType === 'pg') {