Initializergrdb 7.4.0GRDB

init(path:configuration:)

Opens or creates an SQLite database.

DatabaseQueue.swift:40
init(path: String, configuration: Configuration = Configuration()) throws

Parameters

path

The path to the database file.

configuration

A configuration.

Throws

A DatabaseError whenever an SQLite error occurs.

For example:

let dbQueue = try DatabaseQueue(path: "/path/to/database.sqlite")

The SQLite connection is closed when the database queue gets deallocated.