Skip to content

Type Method

open(storage:threadPool:logger:on:)

Open a new connection to an SQLite database.
static func open(storage: SQLiteConnection.Storage = .memory, threadPool: NIOThreadPool, logger: Logger = .init(label: "codes.vapor.sqlite"), on eventLoop: any EventLoop) -> EventLoopFuture<SQLiteConnection>

Parameters

storage

Specifies the location of the database for the connection. See SQLiteConnection.Storage for details.

threadPool

An NIOThreadPool used to execute all libsqlite3 API calls for this connection.

logger

The logger used by the connection. Defaults to a new Logger.

eventLoop

An EventLoop to associate with the connection for creating futures.

Return Value

A future whose value on success is a new connection object.