Skip to content

Add proper support for timestamp arrays #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Sources/PostgresNIO/Data/PostgresDataType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
public static let timestampArray = PostgresDataType(1115)
/// `1184`
public static let timestamptz = PostgresDataType(1184)
/// `1185`
public static let timestamptzArray = PostgresDataType(1185)
/// `1266`
public static let timetz = PostgresDataType(1266)
/// `1700`
Expand Down Expand Up @@ -169,6 +171,7 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
case .timestamp: return "TIMESTAMP"
case .timestamptz: return "TIMESTAMPTZ"
case .timestampArray: return "TIMESTAMP[]"
case .timestamptzArray: return "TIMESTAMPTZ[]"
case .numeric: return "NUMERIC"
case .void: return "VOID"
case .uuid: return "UUID"
Expand Down Expand Up @@ -196,6 +199,8 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
case .jsonb: return .jsonbArray
case .text: return .textArray
case .varchar: return .varcharArray
case .timestamp: return .timestampArray
case .timestamptz: return .timestamptzArray
default: return nil
}
}
Expand All @@ -218,6 +223,8 @@ public struct PostgresDataType: Codable, Equatable, ExpressibleByIntegerLiteral,
case .jsonbArray: return .jsonb
case .textArray: return .text
case .varcharArray: return .varchar
case .timestampArray: return .timestamp
case .timestamptzArray: return .timestamptz
default: return nil
}
}
Expand Down