Files
BIPMaterialManager/src/main/services/database/dialects/index.ts
Misaka 0ca17a1807 fix(db): correct dialect import paths and extend bip-users-dao type
- Fix dialect files to use relative paths instead of @types alias
- Add 'postgresql' to BIPUsersDAO dbType union

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 10:34:03 +08:00

29 lines
884 B
TypeScript

/**
* SQL Dialect Factory
*
* Creates the appropriate SqlDialect implementation based on database type.
*/
import type { DatabaseType } from '../../../types/database.types'
import type { SqlDialect } from '../../../types/sql-dialect.types'
import { MySqlDialect } from './mysql-dialect'
import { PostgreSqlDialect } from './postgresql-dialect'
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) {
case 'sqlserver':
return new SqlServerDialect()
case 'postgresql':
return new PostgreSqlDialect()
default:
return new MySqlDialect()
}
}