Protocol
SQLiteDatabase
A protocol describing the minimum requirements for an object allowing access to a generic SQLite database.
protocol SQLiteDatabase : Sendable
Overview
This protocol is intended to assist with connection pooling and other “smells like a simple database but isn’t” use cases. In retrospect, it has become clear that it was poorly designed. Users and implementations alike should try to use SQLiteConnection directly whenever possible.
Topics
Instance Properties
var eventLoop: any EventLoopThe event loop on which operations on the connection execute.var logger: LoggerThe logger used by the connection.
Instance Methods
func logging(to: Logger) -> any SQLiteDatabaseReturn a newSQLiteDatabasewhich is indistinguishable from the original save that itsloggerproperty is replaced by the givenLogger.func query(_:_:)Wrapper forquery(_:_:_:)which returns the result rows (if any) rather than calling a closure.func query(String, [SQLiteData], (SQLiteRow) -> Void) async throwsExecute a query on the connection, calling the provided closure for each result row (if any).func query(String, [SQLiteData], logger: Logger, (SQLiteRow) -> Void) -> EventLoopFuture<Void>Execute a query on the connection, calling the provided closure for each result row (if any).func withConnection(_:)Call the provided closure with a concreteSQLiteConnectioninstance.
Relationships
Inherits From
Swift.SendableSwift.SendableMetatype