Classgrdb 7.3.0GRDB
AnyDatabaseReader
A type-erased database reader.
final class AnyDatabaseReader
An instance of AnyDatabaseReader
forwards its operations to an underlying base database reader.
A type-erased database reader.
final class AnyDatabaseReader
An instance of AnyDatabaseReader
forwards its operations to an underlying base database reader.
import GRDB
A toolkit for SQLite databases, with a focus on application development
protocol Copyable
A type whose values can be implicitly or explicitly copied.
protocol DatabaseReader : AnyObject, Sendable
A type that reads from an SQLite database.
protocol Escapable
protocol Sendable
init(_ base: any DatabaseReader)
Creates a new database reader that wraps and forwards operations to base
.
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 asyncRead(_ value: @escaping (Result<Database, Error>) -> Void)
func asyncUnsafeRead(_ value: @escaping (Result<Database, Error>) -> Void)
func close() throws
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 unsafeRead<T>(_ value: (Database) throws -> T) throws -> T
func unsafeRead<T>(_ value: @escaping (Database) throws -> T) async throws -> T where T : Sendable
func unsafeReentrantRead<T>(_ value: (Database) throws -> T) throws -> T
func backup(to writer: any DatabaseWriter, pagesPerStep: CInt = -1, progress: ((DatabaseBackupProgress) throws -> Void)? = nil) throws
Copies the database contents into another database.
func dumpContent(format: some DumpFormat = .debug(), to stream: (any TextOutputStream)? = nil) throws
Prints the contents of the database.
func dumpRequest(_ request: some FetchRequest, format: some DumpFormat = .debug(), to stream: (any TextOutputStream)? = nil) throws
Prints the results of a request.
func dumpSQL(_ sql: SQL, format: some DumpFormat = .debug(), to stream: (any TextOutputStream)? = nil) throws
Prints the results of all statements in the provided SQL.
func dumpSchema(to stream: (any TextOutputStream)? = nil) throws
Prints the schema of the database.
func dumpTables(_ tables: [String], format: some DumpFormat = .debug(), tableHeader: DumpTableHeaderOptions = .automatic, stableOrder: Bool = false, to stream: (any TextOutputStream)? = nil) throws
Prints the contents of the provided tables and views.