erase
Erase the database: delete all content, drop all tables, etc.
func erase() async throws
Erase the database: delete all content, drop all tables, etc.
func erase() async throws
import GRDB
A toolkit for SQLite databases, with a focus on application development
protocol DatabaseWriter : DatabaseReader
A type that writes into an SQLite database.
func erase() throws
Erase the database: delete all content, drop all tables, etc.
func vacuum() throws
Rebuilds the database file, repacking it into a minimal amount of disk space.
func vacuum() async throws
Rebuilds the database file, repacking it into a minimal amount of disk space.
func vacuum(into filePath: String) throws
Creates a new database file at the specified path with a minimum amount of disk space.
func vacuum(into filePath: String) async throws
Creates a new database file at the specified path with a minimum amount of disk space.
func add(transactionObserver: some TransactionObserver, extent: Database.TransactionObservationExtent = .observerLifetime)
Adds a transaction observer to the writer connection, so that it gets notified of database changes and transactions.
func asyncWrite<T>(_ updates: @escaping (Database) throws -> T, completion: @escaping (Database, Result<T, Error>) -> Void)
Schedules database operations for execution, and returns immediately.
func remove(transactionObserver: some TransactionObserver)
Removes a transaction observer from the writer connection.
func write<T>(_ updates: (Database) throws -> T) throws -> T
Executes database operations, and returns their result after they have finished executing.
func write<T>(_ updates: @escaping (Database) throws -> T) async throws -> T where T : Sendable
Executes database operations, and returns their result after they have finished executing.