Experiment with settings

This commit is contained in:
Ali
2023-09-24 00:45:38 +04:00
parent c6648090e2
commit 38759d6670
8 changed files with 51 additions and 36 deletions

View File

@@ -25,10 +25,18 @@
import Foundation
import sqlcipher
private let ensureInitialized: Void = {
sqlite3_initialize()
return Void()
}()
public final class Database {
internal var handle: OpaquePointer? = nil
public init?(_ location: String, readOnly: Bool) {
let _ = ensureInitialized
if location != ":memory:" {
let _ = open(location + "-guard", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR)
}