DatabaseService
Defined in: core/src/database/database.service.ts:21
Opens and caches Kysely database connections by id, running migrations to
latest on first access. A service resolved via the Services container.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DatabaseService(services): DatabaseService;Defined in: core/src/database/database.service.ts:25
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
services |
Services |
Returns
Section titled “Returns”DatabaseService
Methods
Section titled “Methods”getInstance()
Section titled “getInstance()”getInstance<TSchema>(options): Promise<Kysely<TSchema>>;Defined in: core/src/database/database.service.ts:60
Returns the connection for options.id, creating and migrating it on first
use and returning the cached instance thereafter. Throws if the instance
could not be created.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
TSchema |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
DatabaseOptions<TSchema> |
Returns
Section titled “Returns”Promise<Kysely<TSchema>>