SQL语句摘要

let db = try! Connection(path!)
try! db.run(sql)
try! db.run(insert)
try! db.run(update)
try! db.run(filter.update(email <- "[email protected]"))
try! db.run(filter1.update(name <- name.replace("r", with: "i")))
try! db.run(users.delete())
try! db.run(users.filter(id == 1).delete())
let seq:AnySequence = try! db.prepare(users)
try! db.prepare(users.select(name))
try! db.prepare(users.select(*))
try! db.prepare(users.select(email).filter(name == "NSLog"))
try! db.scalar(c)
try! db.scalar(users.select(name.count))
try! db.scalar(users.select(name.max))
try! db.scalar(users.select(name.min))
try! db.scalar(users.select(id.average))
try! db.scalar(users.select(name.distinct.count))
try! db.run(users.rename(Table("t_user")))
try! db.run(users.addColumn(sex))
try! db.transaction {}

你可能感兴趣的:(SQL语句摘要)