mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-30 04:28:44 +00:00
Add a preconditionValidQueue to Database.tableExists()
This commit is contained in:
1 parent
48ad154079
commit
18b01ca0c5
1 file changed
+2
@@ -607,6 +607,8 @@ extension Database {
|
||||
|
||||
/// Returns whether a table exists.
|
||||
public func tableExists(tableName: String) -> Bool {
|
||||
preconditionValidQueue()
|
||||
|
||||
// SQlite identifiers are case-insensitive, case-preserving (http://www.alberton.info/dbms_identifiers_and_case_sensitivity.html)
|
||||
return Row.fetchOne(self,
|
||||
"SELECT sql FROM sqlite_master WHERE type = 'table' AND LOWER(name) = ?",
|
||||
|
||||
Reference in new issue
Block a user