Skip to content

Commit

Permalink
Fixed read-only DBs failing the journal check
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoarment committed Apr 29, 2024
1 parent 54119eb commit 076827d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Blackbird/BlackbirdDatabase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ extension Blackbird {

self.maxQueryVariableCount = Int(sqlite3_limit(handle, SQLITE_LIMIT_VARIABLE_NUMBER, -1))

if SQLITE_OK != sqlite3_exec(handle, "PRAGMA journal_mode = WAL", nil, nil, nil) || SQLITE_OK != sqlite3_exec(handle, "PRAGMA synchronous = NORMAL", nil, nil, nil) {
if !normalizedOptions.contains(.readOnly), SQLITE_OK != sqlite3_exec(handle, "PRAGMA journal_mode = WAL", nil, nil, nil) || SQLITE_OK != sqlite3_exec(handle, "PRAGMA synchronous = NORMAL", nil, nil, nil) {
sqlite3_close(handle)
if let path = self.path { InstancePool.removeInstance(path: path) }
throw Error.unsupportedConfigurationAtPath(path: path)
Expand Down

0 comments on commit 076827d

Please sign in to comment.