@storecraft/database-planetscale 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-planetscale",
3
- "version": "1.2.5",
3
+ "version": "1.3.0",
4
4
  "description": "`Storecraft` database driver for `PlanetScale` (cloud mysql)",
5
5
  "license": "MIT",
6
6
  "author": "Tomer Shalev (https://github.com/store-craft)",
@@ -7,7 +7,7 @@ import { migrateToLatest } from '@storecraft/database-planetscale/migrate.js';
7
7
 
8
8
  export const create_app = async () => {
9
9
 
10
- const app = new App(
10
+ return new App(
11
11
  {
12
12
  auth_admins_emails: ['admin@sc.com'],
13
13
  auth_secret_access_token: 'auth_secret_access_token',
@@ -22,23 +22,21 @@ export const create_app = async () => {
22
22
  useSharedConnection: true
23
23
  }
24
24
  )
25
- )
26
-
27
- return app.init();
25
+ ).init();
28
26
  }
29
27
 
30
28
  async function test() {
31
29
  const app = await create_app();
32
30
 
33
- await migrateToLatest(app.db, false);
31
+ await migrateToLatest(app._.db, false);
34
32
 
35
33
  Object.entries(api).slice(0, -1).forEach(
36
34
  ([name, runner]) => {
37
- runner.create(app).run();
35
+ runner.create(app._.app).run();
38
36
  }
39
37
  );
40
- const last_test = Object.values(api).at(-1).create(app);
41
- last_test.after(async ()=>{app.db.disconnect()});
38
+ const last_test = Object.values(api).at(-1).create(app._.app);
39
+ last_test.after(async ()=>{app._.disconnect()});
42
40
  last_test.run();
43
41
  }
44
42