File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,16 @@ export class NodeDatabase implements DB {
2727 private rollbackHookCallback ?: ( ( ) => void ) | null ;
2828
2929 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 } ) ;
30+ this . dbPath = ':memory:'
31+ if ( location !== ":memory:" ) {
32+ const dbLocation = location || './' ;
33+ this . dbPath = path . join ( dbLocation , name ) ;
34+
35+ // Ensure directory exists
36+ const dir = path . dirname ( this . dbPath ) ;
37+ if ( ! fs . existsSync ( dir ) ) {
38+ fs . mkdirSync ( dir , { recursive : true } ) ;
39+ }
3740 }
3841
3942 this . db = new Database ( this . dbPath ) ;
You can’t perform that action at this time.
0 commit comments