Closed duhnnie closed 2 years ago
Would it be possible to cut a new release with this change?
@withzombies Going to do it tomorrow, I add a reminder on my phone. I'm sorry for this!
No worries! I appreciate the work you're doing here
@NathanFallet please undo the merge of the unfinished PR before releasing
Well, we'll wait for #1148 to be merged and then do a release
insertMany(_ encodables: [Encodable])
fails when optional fields (nullable) havenil
as its value on different fields among them.Getting this message/error:
Build Information
General guidelines
struct Person: Codable { let id: Int? let name: String let email: String?
}
let db = try Connection(NSHomeDirectory() + "/dbtest.sqlite")
let person = Table("person") let id = Expression("id")
let name = Expression("name")
let email = Expression<String?>("email")
let createTable = person.create(ifNotExists: true) { t in t.column(id, primaryKey: true) t.column(name) t.column(email) }
try db.run(createTable)
let person1 = Person(name: "John", email: "john@doe.com") let person2 = Person(name: "David", email: nil) let personsArray = [person1, person2]
do { let insert = try person.insertMany(personsArray) try db.run(insert) } catch { print("Error (error.localizedDescription)") }