stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.64k stars 1.56k forks source link

How do I tell if a table exists #975

Closed Gaozn closed 3 years ago

Gaozn commented 4 years ago

rt

icodeuridevice commented 4 years ago

try! DBConnection.Constant.db.run(tblVehicles.create(ifNotExists: true) { t in t.column(id, primaryKey: true) t.column(name) t.column(company, unique: true) })

nathanfallet commented 3 years ago

As @icodeuridevice showed, you can create a table if it doesn't exist yet.