I use this SQLite library and want to delete every row in the table that contains the same email address. So let's say that 100 users is registred with the email: test@test.com, and I want to delete all of them. According to the documentation we can do this:
let alice = users.filter(id == 1)
try db.run(alice.delete())
// DELETE FROM "users" WHERE ("id" = 1)
But the ID's is different for each user. So is it possible to do something like: // DELETE FROM "users" WHERE ("email" = test@test.com).
The email column in the table is a string. Like this: let email = Expression<String>("email")
EDIT:
I tried this, but somehow it deleted all of my rows, not only those who contains the email address:
let alice = users.select(self.email == emails[indexPath.row])
let deleteUser = user.delete()
do {
try self.database.run(deleteUser)
} catch {
print(error)
}