@@ -3,7 +3,7 @@ import Async
33/// Caches table OID to string name associations.
44final class PostgreSQLTableNameCache {
55 /// The internal cache.
6- var storage : [ Int32 : String ]
6+ var storage : [ UInt32 : String ]
77
88 /// Static shared cache, stored by connections.
99 private static var _shared : ThreadSpecificVariable < PostgreSQLTableNameCaches > = . init( )
@@ -22,7 +22,7 @@ final class PostgreSQLTableNameCache {
2222 }
2323
2424 /// Creates a new cache.
25- private init ( _ cache: [ Int32 : String ] ) {
25+ private init ( _ cache: [ UInt32 : String ] ) {
2626 self . storage = cache
2727 }
2828
@@ -37,10 +37,10 @@ final class PostgreSQLTableNameCache {
3737 return Future . map ( on: connection) { existing }
3838 } else {
3939 return connection. simpleQuery ( " select oid, relname from pg_class " ) . map ( to: PostgreSQLTableNameCache . self) { rows in
40- var cache : [ Int32 : String ] = [ : ]
40+ var cache : [ UInt32 : String ] = [ : ]
4141
4242 for row in rows {
43- let oid = try row. firstValue ( forColumn: " oid " ) !. decode ( Int32 . self)
43+ let oid = try row. firstValue ( forColumn: " oid " ) !. decode ( UInt32 . self)
4444 let name = try row. firstValue ( forColumn: " relname " ) !. decode ( String . self)
4545 cache [ oid] = name
4646 }
0 commit comments