refactor(db): use SqlDialect in MaterialsToBeDeletedDAO

Replace all isSqlServer/if-else branches with SqlDialect calls:
- Table name via dialect.quoteTableName()
- Placeholders via dialect.param() and dialect.params()
- UPSERT via dialect.upsert() in upsertMaterial(), upsertBatch(), updateManager()
- Remove buildPlaceholders(), TABLE_NAME_SQLSERVER, TABLE_NAME_MYSQL
- Re-export SqlDialect type from dialects barrel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-05 10:17:21 +08:00
parent 9300f3455f
commit fa57f9e564
2 changed files with 59 additions and 103 deletions

View File

@@ -14,6 +14,7 @@ import { SqlServerDialect } from './sqlserver-dialect'
export { MySqlDialect } from './mysql-dialect'
export { PostgreSqlDialect } from './postgresql-dialect'
export { SqlServerDialect } from './sqlserver-dialect'
export type { SqlDialect } from '@types/sql-dialect.types'
export function createDialect(type: DatabaseType): SqlDialect {
switch (type) {