Instance Methodgrdb 7.2.0GRDB
interrupt
DatabaseQueue.swift:193func interrupt()
func interrupt()
import GRDB
A toolkit for SQLite databases, with a focus on application development
final class DatabaseQueue
A database connection that serializes accesses to an SQLite database.
init(named name: String? = nil, configuration: Configuration = Configuration()) throws
Opens an in-memory SQLite database.
init(path: String, configuration: Configuration = Configuration()) throws
Opens or creates an SQLite database.
static func inMemoryCopy(fromPath path: String, configuration: Configuration = Configuration()) throws -> DatabaseQueue
Returns a connection to an in-memory copy of the database at path
.
static func temporaryCopy(fromPath path: String, configuration: Configuration = Configuration()) throws -> DatabaseQueue
Returns a connection to a private, temporary, on-disk copy of the database at path
.
var configuration: Configuration { get }
var path: String { get }
func _add<Reducer>(observation: ValueObservation<Reducer>, scheduling scheduler: some ValueObservationScheduler, onChange: @escaping (Reducer.Value) -> Void) -> AnyDatabaseCancellable where Reducer : ValueReducer
func asyncBarrierWriteWithoutTransaction(_ updates: @escaping (Result<Database, Error>) -> Void)
func asyncRead(_ value: @escaping (Result<Database, Error>) -> Void)
func asyncUnsafeRead(_ value: @escaping (Result<Database, Error>) -> Void)
func asyncWriteWithoutTransaction(_ updates: @escaping (Database) -> Void)
func barrierWriteWithoutTransaction<T>(_ updates: (Database) throws -> T) throws -> T
func barrierWriteWithoutTransaction<T>(_ updates: @escaping (Database) throws -> T) async throws -> T where T : Sendable
func close() throws
func inDatabase<T>(_ updates: (Database) throws -> T) rethrows -> T
Executes database operations, and returns their result after they have finished executing.
func inTransaction(_ kind: Database.TransactionKind? = nil, _ updates: (Database) throws -> Database.TransactionCompletion) throws
Wraps database operations inside a database transaction.
func read<T>(_ value: (Database) throws -> T) throws -> T
func read<T>(_ value: @escaping (Database) throws -> T) async throws -> T where T : Sendable
func releaseMemory()
Free as much memory as possible.
func spawnConcurrentRead(_ value: @escaping (Result<Database, Error>) -> Void)
func unsafeRead<T>(_ value: (Database) throws -> T) rethrows -> T
func unsafeRead<T>(_ value: @escaping (Database) throws -> T) async throws -> T where T : Sendable
func unsafeReentrantRead<T>(_ value: (Database) throws -> T) rethrows -> T
func unsafeReentrantWrite<T>(_ updates: (Database) throws -> T) rethrows -> T
func writeWithoutTransaction<T>(_ updates: (Database) throws -> T) rethrows -> T
func writeWithoutTransaction<T>(_ updates: @escaping (Database) throws -> T) async throws -> T where T : Sendable