xcode - Docs for the latest version of SQLite.swift -
after updating xcode 6.3 today able totally remove sqlite.swift , reinstall it. , after having fixed 50 errors caused changing down 15 errors remaining , of them have new sqlite.swift. have searched new docs cover syntax changes no avail. errors have found other posts , able fix.
so function used work complains ? after delete()?... error message "optional chain has no effect, expression produces int?'. recommendation remove ?
func delete(id: int) { let rows = db[schema.tablename] rows.filter(schema.id == id).delete()? }
if remove ? after delete() tells me "cannot invoke 'delete' no argument". searched source code , code completion, of not show arguments.
also on update statements error: example code:
rows.filter(schema.id == id) .update(schema.acctid <- acctid, schema.accesscode <- accesscode, schema.status <- 0)
error: cannot invoke 'update' argument list of type '(setter, setter, setter)'
swift 1.2 removed ability coerce using trailing ?
. can use !
if statement shouldn't fail:
func delete(id: int) { let rows = db[schema.tablename] rows.filter(schema.id == id).delete()! }
or can chain delete()
call tuple member, instead:
rows.filter(schema.id == id).delete().changes
this has been continual support issue, interface may change in near future.
the update()
call needs fixed same way:
rows.filter(schema.id == id) .update( schema.acctid <- acctid, schema.accesscode <- accesscode, schema.status <- 0)! // or .changes
Comments
Post a Comment