mardi 18 août 2015

How to Delete Rows with SQLite.SWIFT?

I use SQLite.SWIFT and want to delete rows with specific id from my table.

The documentation here said that I can use:

let delete = delete.update(email <- "alice@me.com")
if let changes = delete.changes where changes > 0 {
    println("deleted alice")
} else if delete.statement.failed {
    println("delete failed: \(delete.statement.reason)")
}

I could not find a global delete function. My table is

let users = db["users"]

How do I perform the delete.update function?

Aucun commentaire:

Enregistrer un commentaire