@@ -22,7 +22,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
2222 var supportsTransactions : Bool { true }
2323 var serverVersion : String ? { libpqConnection? . serverVersion ( ) }
2424 var serverVersionNumber : Int32 { libpqConnection? . serverVersionNumber ( ) ?? 0 }
25- var capabilities : PostgreSQLCapabilities {
25+ var versionedCapabilities : PostgreSQLCapabilities {
2626 PostgreSQLCapabilities ( serverVersion: serverVersionNumber)
2727 }
2828 var parameterStyle : ParameterStyle { . dollar }
@@ -234,7 +234,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
234234
235235 func fetchTables( schema: String ? ) async throws -> [ PluginTableInfo ] {
236236 let schemaLiteral = escapeLiteral ( schema ?? _currentSchema)
237- let caps = capabilities
237+ let caps = versionedCapabilities
238238
239239 var unions : [ String ] = [
240240 """
@@ -284,7 +284,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
284284
285285
286286 func fetchIndexes( table: String , schema: String ? ) async throws -> [ PluginIndexInfo ] {
287- let columnOrdering = capabilities . hasArrayPosition
287+ let columnOrdering = versionedCapabilities . hasArrayPosition
288288 ? " ORDER BY array_position(ix.indkey, a.attnum) "
289289 : " ORDER BY a.attnum "
290290 let query = """
@@ -433,7 +433,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
433433 func fetchTableDDL( table: String , schema: String ? ) async throws -> String {
434434 let safeTable = escapeLiteral ( table)
435435 let quotedTable = " \" \( table. replacingOccurrences ( of: " \" " , with: " \" \" " ) ) \" "
436- let caps = capabilities
436+ let caps = versionedCapabilities
437437
438438 let identityClause : String = caps. hasIdentityColumns ? """
439439 CASE
@@ -672,7 +672,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
672672 }
673673
674674 func fetchDependentSequences( table: String , schema: String ? ) async throws -> [ ( name: String , ddl: String ) ] {
675- guard capabilities . hasSequencesCatalog else { return [ ] }
675+ guard versionedCapabilities . hasSequencesCatalog else { return [ ] }
676676 let safeTable = escapeLiteral ( table)
677677 let query = """
678678 SELECT s.sequencename,
@@ -720,7 +720,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
720720 ]
721721
722722 func createDatabaseFormSpec( ) async throws -> PluginCreateDatabaseFormSpec ? {
723- let supportsProvider = capabilities . hasDatabaseICULocale
723+ let supportsProvider = versionedCapabilities . hasDatabaseICULocale
724724
725725 async let templateDefaultsTask = fetchTemplate1Defaults ( )
726726 async let collationsTask = fetchCollations ( )
@@ -813,7 +813,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
813813
814814 var sql = " CREATE DATABASE \" \( quotedName) \" ENCODING ' \( encoding) ' "
815815
816- let supportsProvider = capabilities . hasDatabaseICULocale
816+ let supportsProvider = versionedCapabilities . hasDatabaseICULocale
817817 let provider = supportsProvider ? ( request. values [ " provider " ] ?? " libc " ) : " libc "
818818
819819 switch provider {
@@ -873,7 +873,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
873873 )
874874 }
875875 let escapedIcu = escapeLiteral ( icuLocale)
876- if let major = majorVersion , major >= 16 {
876+ if versionedCapabilities . hasModernICUSyntax {
877877 sql += " LOCALE_PROVIDER 'icu' LOCALE ' \( escapedIcu) ' TEMPLATE template0 "
878878 } else {
879879 sql += " LOCALE_PROVIDER 'icu' ICU_LOCALE ' \( escapedIcu) ' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0 "
@@ -903,7 +903,7 @@ final class PostgreSQLPluginDriver: PluginDatabaseDriver, @unchecked Sendable {
903903 }
904904
905905 private func fetchTemplate1Defaults( ) async -> Template1Defaults ? {
906- let caps = capabilities
906+ let caps = versionedCapabilities
907907 let selectColumns : String
908908 if caps. hasDatabaseLocale {
909909 selectColumns = " datcollate, datctype, datlocprovider, datlocale "
0 commit comments