Sqlite.swift: CREATE TABLE IF NOT EXISTS?

Created on 7 Feb 2018  路  1Comment  路  Source: stephencelis/SQLite.swift

How do you pass a "IF NOT EXISTS" option to create() so that the create() function creates the table only if it doesn't exist?

Most helpful comment

SOLVED:
try db.run(users.create(ifNotExists: true) { t in /* ... */ })

>All comments

SOLVED:
try db.run(users.create(ifNotExists: true) { t in /* ... */ })

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pgawlowski picture pgawlowski  路  6Comments

zackdh9 picture zackdh9  路  5Comments

lucascorrea picture lucascorrea  路  5Comments

WDDong picture WDDong  路  7Comments

askari01 picture askari01  路  7Comments