Skip to content

Commit e811183

Browse files
committed
refactor(table): write the column strip's row condition as one sql clause, without a type cast
1 parent f0dd6eb commit e811183

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎apps/sim/lib/table/columns/service.ts‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { userTableDefinitions, userTableRows } from '@sim/db/schema'
2020
import { createLogger } from '@sim/logger'
2121
import { resolveCurrencyCode } from '@sim/table-cells/currency'
2222
import { omit } from '@sim/utils/object'
23-
import { and, asc, count, eq, gt, type SQL, sql } from 'drizzle-orm'
23+
import { and, asc, count, eq, gt, sql } from 'drizzle-orm'
2424
import { OrchestrationError } from '@/lib/core/orchestration/types'
2525
import { columnMatchesRef, generateColumnId, getColumnId } from '@/lib/table/column-keys'
2626
import {
@@ -395,10 +395,7 @@ async function stripColumnData(
395395
columnIds: string[]
396396
): Promise<void> {
397397
await updateTableRowsWithDerivedSecretProvenance(trx, {
398-
rowWhere: and(
399-
eq(userTableRows.tableId, tableId),
400-
eq(userTableRows.workspaceId, workspaceId)
401-
) as SQL,
398+
rowWhere: sql`${userTableRows.tableId} = ${tableId} and ${userTableRows.workspaceId} = ${workspaceId}`,
402399
transformation: { mode: 'remove-columns', columnIds },
403400
})
404401
}

0 commit comments

Comments
 (0)