Experimental SQLite support
This commit is contained in:
@@ -6,6 +6,7 @@ import {Unit} from '../../lifecycle/Unit'
|
||||
import {Config} from '../../service/Config'
|
||||
import {Logging} from '../../service/Logging'
|
||||
import {MigratorFactory} from '../migrations/MigratorFactory'
|
||||
import {SQLiteConnection} from '../connection/SQLiteConnection'
|
||||
|
||||
/**
|
||||
* Application unit responsible for loading and creating database connections from config.
|
||||
@@ -48,6 +49,8 @@ export class Database extends Unit {
|
||||
let conn
|
||||
if ( config?.dialect === 'postgres' ) {
|
||||
conn = <PostgresConnection> this.app().make(PostgresConnection, key, config)
|
||||
} else if ( config?.dialect === 'sqlite' ) {
|
||||
conn = <SQLiteConnection> this.app().make(SQLiteConnection, key, config)
|
||||
} else {
|
||||
const e = new ErrorWithContext(`Invalid or missing database dialect: ${config.dialect}. Should be one of: postgres`)
|
||||
e.context = { connectionName: key }
|
||||
|
||||
Reference in New Issue
Block a user