@@ -210,6 +210,28 @@ class FluentPostgreSQLTests: XCTestCase {
210210 try benchmarker. benchmarkContains_withSchema ( )
211211 }
212212
213+ func testGH30( ) throws {
214+ /// - types
215+ struct Foo : PostgreSQLModel , Migration {
216+ static let entity = " foos "
217+ var id : Int ?
218+ var location : PostgreSQLPoint ?
219+ }
220+
221+ /// - prepare db
222+ benchmarker. database. enableLogging ( using: . print)
223+ let conn = try benchmarker. pool. requestConnection ( ) . wait ( )
224+ defer { try ? Foo . revert ( on: conn) . wait ( ) }
225+ try Foo . prepare ( on: conn) . wait ( )
226+
227+ /// - tests
228+ var foo = Foo ( id: nil , location: PostgreSQLPoint ( x: 1 , y: 3.14 ) )
229+ foo = try foo. save ( on: conn) . wait ( )
230+ foo = try Foo . find ( foo. requireID ( ) , on: conn) . wait ( ) !
231+ XCTAssertEqual ( foo. location? . x, 1 )
232+ XCTAssertEqual ( foo. location? . y, 3.14 )
233+ }
234+
213235 static let allTests = [
214236 ( " testSchema " , testSchema) ,
215237 ( " testModels " , testModels) ,
@@ -228,6 +250,7 @@ class FluentPostgreSQLTests: XCTestCase {
228250 ( " testGH21 " , testGH21) ,
229251 ( " testPersistsDateMillisecondPart " , testPersistsDateMillisecondPart) ,
230252 ( " testContains " , testContains) ,
253+ ( " testGH30 " , testGH30) ,
231254 ]
232255}
233256
0 commit comments