Skip to content

Commit 3b989aa

Browse files
authored
convert Fluent's uint8 type to postgres char (#132)
1 parent 7c95e2d commit 3b989aa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/FluentPostgresDriver/PostgresConverterDelegate.swift

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import FluentSQL
33
struct PostgresConverterDelegate: SQLConverterDelegate {
44
func customDataType(_ dataType: DatabaseSchema.DataType) -> SQLExpression? {
55
switch dataType {
6+
case .uint8:
7+
return SQLRaw(#""char""#)
68
case .uuid:
79
return SQLRaw("UUID")
810
case .bool:

Tests/FluentPostgresDriverTests/FluentPostgresDriverTests.swift

+8
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ final class FluentPostgresDriverTests: XCTestCase {
167167
func testDuplicatedUniquePropertyName() throws {
168168
try self.benchmarker.testDuplicatedUniquePropertyName()
169169
}
170+
171+
func testEmptyEagerLoadChildren() throws {
172+
try self.benchmarker.testEmptyEagerLoadChildren()
173+
}
174+
175+
func testUInt8BackedEnum() throws {
176+
try self.benchmarker.testUInt8BackedEnum()
177+
}
170178

171179
func testBlob() throws {
172180
final class Foo: Model {

0 commit comments

Comments
 (0)