@@ -15,12 +15,21 @@ struct TableQueryBuilder {
1515
1616 private let databaseType : DatabaseType
1717 private var pluginDriver : ( any PluginDatabaseDriver ) ?
18+ private let dialectQuote : ( String ) -> String
1819
1920 // MARK: - Initialization
2021
21- init ( databaseType: DatabaseType , pluginDriver: ( any PluginDatabaseDriver ) ? = nil ) {
22+ init (
23+ databaseType: DatabaseType ,
24+ pluginDriver: ( any PluginDatabaseDriver ) ? = nil ,
25+ dialectQuote: ( ( String ) -> String ) ? = nil
26+ ) {
2227 self . databaseType = databaseType
2328 self . pluginDriver = pluginDriver
29+ self . dialectQuote = dialectQuote ?? { name in
30+ let escaped = name. replacingOccurrences ( of: " \" " , with: " \" \" " )
31+ return " \" \( escaped) \" "
32+ }
2433 }
2534
2635 mutating func setPluginDriver( _ driver: ( any PluginDatabaseDriver ) ? ) {
@@ -31,8 +40,7 @@ struct TableQueryBuilder {
3140
3241 private func quote( _ name: String ) -> String {
3342 if let pluginDriver { return pluginDriver. quoteIdentifier ( name) }
34- let escaped = name. replacingOccurrences ( of: " \" " , with: " \" \" " )
35- return " \" \( escaped) \" "
43+ return dialectQuote ( name)
3644 }
3745
3846 // MARK: - Query Building
0 commit comments