@storecraft/database-sqlite 1.2.5 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storecraft/database-sqlite",
3
- "version": "1.2.5",
3
+ "version": "1.3.0",
4
4
  "description": "Official SQLite Database driver for storecraft",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -5,6 +5,7 @@ import { NodePlatform } from '@storecraft/core/platform/node';
5
5
  import { api } from '@storecraft/core/test-runner';
6
6
  import { homedir } from 'node:os';
7
7
  import { join } from 'node:path';
8
+ import { NodeLocalStorage } from '@storecraft/core/storage/node';
8
9
 
9
10
  export const create_app = async () => {
10
11
  const app = new App(
@@ -18,11 +19,10 @@ export const create_app = async () => {
18
19
  )
19
20
  .withPlatform(new NodePlatform())
20
21
  .withDatabase(
21
- new SQLite({ filepath: join(homedir(), 'db.sqlite') })
22
- );
22
+ new SQLite({ filepath: ':memory:' })
23
+ ).init();
23
24
 
24
- await app.init();
25
- await migrateToLatest(app.db, false);
25
+ await migrateToLatest(app._.db, false);
26
26
 
27
27
  return app;
28
28
  }
@@ -32,11 +32,11 @@ async function test() {
32
32
 
33
33
  Object.entries(api).slice(0, -1).forEach(
34
34
  ([name, runner]) => {
35
- runner.create(app).run();
35
+ runner.create(app._.app).run();
36
36
  }
37
37
  );
38
- const last_test = Object.values(api).at(-1).create(app);
39
- last_test.after(async () => { await app.db.disconnect() });
38
+ const last_test = Object.values(api).at(-1).create(app._.app);
39
+ last_test.after(async () => { await app._.db.disconnect() });
40
40
  last_test.run();
41
41
  }
42
42