|
|
|
@ -1483,10 +1483,26 @@ export class ColumnsService {
|
|
|
|
|
UITypes.MultiSelect, |
|
|
|
|
].includes(column.uidt) |
|
|
|
|
) { |
|
|
|
|
const dbDriver = await reuseOrSave('dbDriver', reuse, async () => |
|
|
|
|
NcConnectionMgrv2.get(source), |
|
|
|
|
); |
|
|
|
|
const driverType = dbDriver.clientType(); |
|
|
|
|
|
|
|
|
|
let trimColumn = `??`; |
|
|
|
|
if (driverType === 'mysql' || driverType === 'mysql2') { |
|
|
|
|
trimColumn = `TRIM(BOTH ' ' FROM ??)`; |
|
|
|
|
} else if (driverType === 'pg') { |
|
|
|
|
trimColumn = `BTRIM(??)`; |
|
|
|
|
} else if (driverType === 'mssql') { |
|
|
|
|
trimColumn = `LTRIM(RTRIM(??))`; |
|
|
|
|
} else if (driverType === 'sqlite3') { |
|
|
|
|
trimColumn = `TRIM(??)`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setStatement = baseUsers |
|
|
|
|
.map((user) => |
|
|
|
|
sqlClient.knex |
|
|
|
|
.raw('WHEN ?? = ? THEN ?', [ |
|
|
|
|
.raw(`WHEN ${trimColumn} = ? THEN ?`, [ |
|
|
|
|
column.column_name, |
|
|
|
|
user.email, |
|
|
|
|
user.id, |
|
|
|
|