- 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>
29 lines
884 B
TypeScript
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()
|
|
}
|
|
}
|