Skip to content

Commit 21eebbc

Browse files
committed
Update YTKTable.swift
modify: YTKTable `isExists` method
1 parent 837e8a7 commit 21eebbc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: YTKKeyValueStore/YTKKeyValueStore/YTKTable.swift

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ public struct YTKTable{
1616

1717
public var isExists : Bool {
1818
get{
19-
return self.tableHandle != nil
19+
guard tableHandle != nil else{
20+
return false
21+
}
22+
return db?.scalar("SELECT EXISTS (SELECT * FROM sqlite_master WHERE type = 'table' AND name = ?)",name) as! Int64 > 0
2023
}
2124
}
2225

0 commit comments

Comments
 (0)