We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e9b28d2 commit 5f3a102Copy full SHA for 5f3a102
1 file changed
node/src/database.ts
@@ -27,13 +27,16 @@ export class NodeDatabase implements DB {
27
private rollbackHookCallback?: (() => void) | null;
28
29
constructor(name: string, location?: string) {
30
- const dbLocation = location || './';
31
- this.dbPath = path.join(dbLocation, name);
32
-
33
- // Ensure directory exists
34
- const dir = path.dirname(this.dbPath);
35
- if (!fs.existsSync(dir)) {
36
- fs.mkdirSync(dir, { recursive: true });
+ this.dbPath = ':memory:'
+ if(location !== ":memory:") {
+ const dbLocation = location || './';
+ this.dbPath = path.join(dbLocation, name);
+
+ // Ensure directory exists
+ const dir = path.dirname(this.dbPath);
37
+ if (!fs.existsSync(dir)) {
38
+ fs.mkdirSync(dir, { recursive: true });
39
+ }
40
}
41
42
this.db = new Database(this.dbPath);
0 commit comments