SQL语句摘要

let db = try! Connection(path!)
try! db.run(sql)
try! db.run(insert)
try! db.run(update)
try! db.run(filter.update(email <- "andy@qq.com"))
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 {}

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • [转]SQLite.swift Documentation InstallationCarthageCocoaPo...
    mqhong阅读 7,398评论 0 2
  • Getting Started Use the Current Stable Version (7.1) Buil...
    Leonzai阅读 1,994评论 0 3
  • TABLE OF CONTENTS Introduction 7 Overview of FortiCloud 7...
    Bouw阅读 2,544评论 0 0
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,268评论 19 139
  • 转发:ORM源码分析[https://www.cnblogs.com/chaochaofan/p/16031348...
    dingxutao阅读 1,470评论 0 1