asyncRead(_:)
DatabaseQueue.swift:246func asyncRead(_ value: @escaping (Result<Database, Error>) -> Void)
func asyncRead(_ value: @escaping (Result<Database, Error>) -> Void)
s4GRDB13DatabaseQueueC9asyncReadyyys6ResultOyAA0B0Cs5Error_pGYbcF
What are these?40ZTJ
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.
@frozen enum Result<Success, Failure> where Failure : Error, Success : ~Copyable
A value that represents either a success or a failure, including an associated value in each case.
final class Database
An SQLite connection.
protocol Error : Sendable
A type representing an error value that can be thrown.
typealias Void = ()
The return type of functions that don’t explicitly specify a return type, that is, an empty tuple ()
.
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 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 interrupt()
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