Skip to content

Commit

Permalink
PostgreSQL doesn't like BLOB as a type, override it for SQLKit users.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne committed May 2, 2024
1 parent 9535dc5 commit eef600a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/PostgresKit/PostgresDialect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public struct PostgresDialect: SQLDialect {
public func customDataType(for dataType: SQLDataType) -> (any SQLExpression)? {
if case let .custom(expr) = dataType, (expr as? SQLRaw)?.sql == "TIMESTAMP" {
return SQLRaw("TIMESTAMPTZ")
} else if case .blob = dataType {
return SQLRaw("BYTEA")
} else {
return nil
}
Expand Down

0 comments on commit eef600a

Please sign in to comment.