Skip to content

Commit 1772b32

Browse files
committed
Properly support timestamp arrays
1 parent d97f268 commit 1772b32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/PostgresNIO/Data/PostgresDataType.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
9191
public static let timestampArray = PostgresDataType(1115)
9292
/// `1184`
9393
public static let timestamptz = PostgresDataType(1184)
94+
/// `1115`
95+
public static let timestamptzArray = PostgresDataType(1185)
9496
/// `1266`
9597
public static let timetz = PostgresDataType(1266)
9698
/// `1700`
@@ -169,6 +171,7 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
169171
case .timestamp: return "TIMESTAMP"
170172
case .timestamptz: return "TIMESTAMPTZ"
171173
case .timestampArray: return "TIMESTAMP[]"
174+
case .timestamptzArray: return "TIMESTAMPTZ[]"
172175
case .numeric: return "NUMERIC"
173176
case .void: return "VOID"
174177
case .uuid: return "UUID"
@@ -196,6 +199,8 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
196199
case .jsonb: return .jsonbArray
197200
case .text: return .textArray
198201
case .varchar: return .varcharArray
202+
case .timestamp: return .timestampArray
203+
case .timestamptz: return .timestamptzArray
199204
default: return nil
200205
}
201206
}
@@ -218,6 +223,7 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
218223
case .jsonbArray: return .jsonb
219224
case .textArray: return .text
220225
case .varcharArray: return .varchar
226+
case .timestampArray: return .timestamp
221227
default: return nil
222228
}
223229
}

0 commit comments

Comments
 (0)