Skip to content

Type Method

open(storage:logger:)

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

Parameters

storage

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

logger

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

Return Value

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

Discussion

This is equivalent to invoking open(storage:threadPool:logger:on:) using the NIOThreadPool and MultiThreadedEventLoopGroup singletons. This is the recommended configuration for all users.