mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-25 13:31:22 +00:00
no message
This commit is contained in:
@@ -97,8 +97,8 @@ public final class Database {
|
||||
/// Executes a batch of SQL statements.
|
||||
///
|
||||
/// - parameter SQL: A batch of zero or more semicolon-separated SQL statements.
|
||||
public func execute(_ SQL: String) {
|
||||
sqlite3_exec(self.handle, SQL, nil, nil, nil)
|
||||
public func execute(_ SQL: String) -> Bool {
|
||||
return sqlite3_exec(self.handle, SQL, nil, nil, nil) == SQLITE_OK
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ public final class SqliteInterface {
|
||||
|
||||
public init?(databasePath: String) {
|
||||
if let database = Database(databasePath) {
|
||||
if !database.execute("pragma schema_version") {
|
||||
return nil
|
||||
}
|
||||
self.database = database
|
||||
} else {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user