Don't ensure directory exists if :memory: storage is used
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -33,7 +33,11 @@ export function createSqliteDatabaseClient(
|
||||
const knexConfig = buildSqliteDatabaseConfig(dbConfig, overrides);
|
||||
|
||||
// If storage on disk is used, ensure that the directory exists
|
||||
if ((knexConfig.connection as Knex.Sqlite3ConnectionConfig).filename) {
|
||||
if (
|
||||
(knexConfig.connection as Knex.Sqlite3ConnectionConfig).filename &&
|
||||
(knexConfig.connection as Knex.Sqlite3ConnectionConfig).filename !==
|
||||
':memory:'
|
||||
) {
|
||||
const { filename } = knexConfig.connection as Knex.Sqlite3ConnectionConfig;
|
||||
const directory = path.dirname(filename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user