mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-25 04:07:47 +00:00
This enables easier compilation of a custom version of SQLite that itself uses the SQLITE_HAS_CODEC define. (ex. If building SQLite with the SQLite Encryption Extension.) The SQLITE_HAS_CODEC define is now only used to guard use of the SQLite encryption APIs. GRDBCipher builds define USING_BUILTIN_SQLITE and USING_SQLCIPHER.
28 lines
749 B
Swift
28 lines
749 B
Swift
import XCTest
|
|
#if USING_SQLCIPHER
|
|
import GRDBCipher
|
|
#elseif USING_CUSTOMSQLITE
|
|
import GRDBCustomSQLite
|
|
#else
|
|
import GRDB
|
|
#endif
|
|
|
|
class DatabasePoolCrashTests: GRDBCrashTestCase {
|
|
|
|
func testReaderCanNotStartTransaction() {
|
|
assertCrash("DatabasePool readers can not start transactions or savepoints.") {
|
|
try dbPool.read { db in
|
|
let statement = try db.updateStatement("BEGIN TRANSACTION")
|
|
}
|
|
}
|
|
}
|
|
|
|
func testReaderCanNotStartSavepoint() {
|
|
assertCrash("DatabasePool readers can not start transactions or savepoints.") {
|
|
try dbPool.read { db in
|
|
let statement = try db.updateStatement("SAVEPOINT foo")
|
|
}
|
|
}
|
|
}
|
|
}
|