File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -496,7 +496,8 @@ final class PluginManager {
496496
497497 func autoLimitStyle( for databaseType: DatabaseType ) -> AutoLimitStyle {
498498 guard let plugin = driverPlugin ( for: databaseType) else { return . limit }
499- return Swift . type ( of: plugin) . sqlDialect? . autoLimitStyle ?? . limit
499+ guard let dialect = Swift . type ( of: plugin) . sqlDialect else { return . none }
500+ return dialect. autoLimitStyle
500501 }
501502
502503 func paginationStyle( for databaseType: DatabaseType ) -> SQLDialectDescriptor . PaginationStyle {
Original file line number Diff line number Diff line change @@ -334,8 +334,11 @@ extension MainContentCoordinator {
334334 if let adapter = driver as? PluginDriverAdapter {
335335 try await adapter. switchDatabase ( to: database)
336336 }
337+ let defaultSchema = pm. defaultSchemaName ( for: connection. type)
337338 DatabaseManager . shared. updateSession ( connectionId) { session in
338339 session. currentDatabase = database
340+ // Reset schema to plugin default (e.g. "dbo" for MSSQL)
341+ session. currentSchema = defaultSchema
339342 }
340343 }
341344 AppSettingsStorage . shared. saveLastDatabase ( database, for: connectionId)
Original file line number Diff line number Diff line change @@ -953,8 +953,10 @@ final class MainContentCoordinator {
953953 }
954954 }
955955
956- // Fetch CHECK constraint pseudo-enum values from DDL (matches only SQLite-style constraints)
957- if let createSQL = try ? await driver. fetchTableDDL ( table: tableName) {
956+ // Fetch CHECK constraint pseudo-enum values from DDL (SQLite-style CHECK ... IN constraints).
957+ // Only attempt DDL parsing when no enum values were found via catalog (avoids unnecessary
958+ // fetchTableDDL calls for databases that don't use CHECK constraints for enums).
959+ if result. isEmpty, let createSQL = try ? await driver. fetchTableDDL ( table: tableName) {
958960 let columns = try ? await driver. fetchColumns ( table: tableName)
959961 for col in columns ?? [ ] {
960962 if let values = Self . parseSQLiteCheckConstraintValues (
You can’t perform that action at this time.
0 commit comments