Skip to content

Commit

Permalink
Sqlite journal_mode disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
flypaper0 committed Nov 2, 2023
1 parent d59c8c5 commit bd40f8e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions Sources/Database/DiskSqlite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ public final class DiskSqlite: Sqlite {
guard sqlite3_open_v2(path, &db, SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_FULLMUTEX, nil) == SQLITE_OK else {
throw SQLiteError.openDatabase(path: path)
}
var error: UnsafeMutablePointer<CChar>?
guard sqlite3_exec(db, "PRAGMA journal_mode=WAL;", nil, nil, &error) == SQLITE_OK else {
let message = error.map { String(cString: $0) }
throw SQLiteError.exec(error: message)
}
}

public func query<Row: SqliteRow>(sql: String) throws -> [Row] {
Expand Down
5 changes: 0 additions & 5 deletions Sources/Database/MemorySqlite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ public final class MemorySqlite: Sqlite {
guard sqlite3_open_v2(":memory:", &db, SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE|SQLITE_OPEN_FULLMUTEX, nil) == SQLITE_OK else {
throw SQLiteError.openDatabaseMemory
}
var error: UnsafeMutablePointer<CChar>?
guard sqlite3_exec(db, "PRAGMA journal_mode=WAL;", nil, nil, &error) == SQLITE_OK else {
let message = error.map { String(cString: $0) }
throw SQLiteError.exec(error: message)
}
}

public func openDatabase() throws {
Expand Down

0 comments on commit bd40f8e

Please sign in to comment.