Hotenka // Set SQLite journal mode == OFF.

This commit is contained in:
ShikiSuen 2024-01-07 18:48:31 +08:00
parent 86bab5c7a8
commit 53effaae0a
2 changed files with 5 additions and 0 deletions

View File

@ -80,6 +80,7 @@ public class HotenkaChineseConverter {
ptrSQL = nil ptrSQL = nil
return return
} }
sqlite3_exec(ptrSQL, "PRAGMA journal_mode = OFF;", nil, nil, nil)
} }
public init(plistDir: String) { public init(plistDir: String) {

View File

@ -51,6 +51,10 @@ extension HotenkaTests {
sqlite3_exec(ptrSQL, "PRAGMA synchronous = OFF;", nil, nil, nil) == SQLITE_OK, sqlite3_exec(ptrSQL, "PRAGMA synchronous = OFF;", nil, nil, nil) == SQLITE_OK,
"HOTENKA: SQLite synchronous OFF failed." "HOTENKA: SQLite synchronous OFF failed."
) )
XCTAssertTrue(
sqlite3_exec(ptrSQL, "PRAGMA journal_mode = OFF;", nil, nil, nil) == SQLITE_OK,
"HOTENKA: SQLite journal_mode OFF failed."
)
let sqlMakeTableHotenka = """ let sqlMakeTableHotenka = """
DROP TABLE IF EXISTS DATA_HOTENKA; DROP TABLE IF EXISTS DATA_HOTENKA;