Closed tanner0101 closed 6 years ago
@tanner0101 Please take a look at this: https://github.com/vapor/fluent-postgresql/issues/20
@abbasmousavi take a look at the release notes here: https://github.com/vapor/fluent-postgresql/releases/tag/1.0.0-rc.1.1
It's due to an incomplete implementation of conditional conformance by Swift. Nothing we can do about it :(
@tanner0101 , thanks for the explanation. What about an array of a custom type, is it possible? for example
struct Pet: PostgreSQLJSONType, Codable {
var name: String
var type: String
}
struct Person: PostgreSQLModel, Migration{
var id: Int?
var title: String
var pets: [Pet]?
}
Adds array support conveniences to Fluent PostgreSQL.
Array
automatically becomesT[]
columnDictionary
automatically becomesJSONB
columnPet
below) can be conformed toPostgreSQLType
PostgreSQLJSONType
for easyJSONB
conformance (where Self isCodable
)PostgreSQLArrayType
for easyT[]
conformance (where Element is aPostgreSQLType
)Results in: