Swift-Kuery-SQLite
Swift-Kuery-SQLite copied to clipboard
[Issue] libsqlite3.dylib: illegal multi-threaded access to database connection?
macOS 10.15.6 Xcode 11.6
How do i resolve this problem?
[logging] BUG IN CLIENT OF libsqlite3.dylib: illegal multi-threaded access to database connection
self.pool = SQLiteConnection.createPool(filename: self.fileName,
poolOptions: ConnectionPoolOptions(initialCapacity: 10,
maxCapacity: 30))
Database.default = Database(pool)
Could update SQLiteConnection.swift ?
public static func createPool(_ location: Location = .inMemoryShared, poolOptions: ConnectionPoolOptions) -> ConnectionPool {
let connectionGenerator: () -> Connection? = {
let connection = SQLiteConnection(location)
//if sqlite3_open(location.description, &connection.connection) != SQLITE_OK {
if sqlite3_open_v2(location.description, &connection.connection, SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nil) != SQLITE_OK {
return nil
}
.
.
.