Skip to content

Commit

Permalink
Fix variable names in database config
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Sep 21, 2023
1 parent 13645f4 commit 48b6488
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions packages/core/src/config/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ export const buildDatabase = ({
}): Database => {
let resolvedDatabaseConfig: NonNullable<ResolvedConfig["database"]>;

const defaultEventStoreSqliteDirectory = path.join(
options.ponderDir,
"cache"
);
const defaultSqliteDirectory = path.join(options.ponderDir, "cache");

if (config.database) {
if (config.database.kind === "postgres") {
Expand All @@ -110,8 +107,7 @@ export const buildDatabase = ({
} else {
resolvedDatabaseConfig = {
kind: "sqlite",
directory:
config.database.directory ?? defaultEventStoreSqliteDirectory,
directory: config.database.directory ?? defaultSqliteDirectory,
};
}
} else {
Expand All @@ -123,7 +119,7 @@ export const buildDatabase = ({
} else {
resolvedDatabaseConfig = {
kind: "sqlite",
directory: defaultEventStoreSqliteDirectory,
directory: defaultSqliteDirectory,
};
}
}
Expand All @@ -137,9 +133,9 @@ export const buildDatabase = ({
filename
);
ensureDirExists(dbFilePath);
const eventStoreRawDb = Sqlite(dbFilePath);
eventStoreRawDb.pragma("journal_mode = WAL");
return patchSqliteDatabase({ db: eventStoreRawDb });
const rawDb = Sqlite(dbFilePath);
rawDb.pragma("journal_mode = WAL");
return patchSqliteDatabase({ db: rawDb });
}
);

Expand Down

0 comments on commit 48b6488

Please sign in to comment.