Compiler error trying to insert a row

问题内容:

I get the following compiler error when I try to build an insert statement: Value of type Table has no member adbc

This is the code I am using:

let ev = Table("events")
do {
    let rowid = try db.run(ev.insert(ev.adbc <- tadbc, ev.year <- tyear,
    ev.month <- tmonth, ev.day <- tday, ev.ampm <- tampm,
    ev.hour <- thour, ev.min <- tmin, ev.sec <- tsec,
    ev.cat <- tcat, ev.eventdesc <- teventdesc))
    // no error was thrown
    return true
} catch {
    // an error was thrown
    return false
}

The field adbc is in the db schema. Only the very first insert field is flagged. Oddly, if I delete ev.adbc <- tadbc, the new first entry is flagged. Strange. Any suggestions?

I am using Swift 4, Xcode9 and SQLite.swift

问题评论:

    
Sorry, I am using Swift 4, Xcode9 and SQLite.swift.
– Buz Fifer
37 mins ago
    
Don’t post a comment. Edit your question as needed.

原文地址:

https://stackoverflow.com/questions/47756479/compiler-error-trying-to-insert-a-row

添加评论

友情链接:蝴蝶教程