@instantdb/core 0.22.86-experimental.split-store.20178922132.1 → 0.22.86-experimental.split-store.20183617880.1

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.
Files changed (45) hide show
  1. package/__tests__/src/Reactor.test.js +18 -11
  2. package/__tests__/src/{datalog.test.js → datalog.test.ts} +17 -5
  3. package/__tests__/src/{instaml.test.js → instaml.test.ts} +183 -119
  4. package/__tests__/src/instaql.bench.ts +34 -0
  5. package/__tests__/src/{instaql.test.js → instaql.test.ts} +342 -455
  6. package/__tests__/src/instaqlInference.test.js +13 -9
  7. package/__tests__/src/{store.test.js → store.test.ts} +188 -210
  8. package/dist/commonjs/Reactor.d.ts +4 -1
  9. package/dist/commonjs/Reactor.d.ts.map +1 -1
  10. package/dist/commonjs/Reactor.js +22 -12
  11. package/dist/commonjs/Reactor.js.map +1 -1
  12. package/dist/commonjs/instaml.d.ts +3 -3
  13. package/dist/commonjs/instaml.d.ts.map +1 -1
  14. package/dist/commonjs/instaml.js +2 -2
  15. package/dist/commonjs/instaml.js.map +1 -1
  16. package/dist/commonjs/instaql.d.ts +2 -2
  17. package/dist/commonjs/instaql.d.ts.map +1 -1
  18. package/dist/commonjs/instaql.js.map +1 -1
  19. package/dist/commonjs/store.d.ts +28 -9
  20. package/dist/commonjs/store.d.ts.map +1 -1
  21. package/dist/commonjs/store.js +13 -8
  22. package/dist/commonjs/store.js.map +1 -1
  23. package/dist/esm/Reactor.d.ts +4 -1
  24. package/dist/esm/Reactor.d.ts.map +1 -1
  25. package/dist/esm/Reactor.js +22 -12
  26. package/dist/esm/Reactor.js.map +1 -1
  27. package/dist/esm/instaml.d.ts +3 -3
  28. package/dist/esm/instaml.d.ts.map +1 -1
  29. package/dist/esm/instaml.js +3 -3
  30. package/dist/esm/instaml.js.map +1 -1
  31. package/dist/esm/instaql.d.ts +2 -2
  32. package/dist/esm/instaql.d.ts.map +1 -1
  33. package/dist/esm/instaql.js.map +1 -1
  34. package/dist/esm/store.d.ts +28 -9
  35. package/dist/esm/store.d.ts.map +1 -1
  36. package/dist/esm/store.js +11 -6
  37. package/dist/esm/store.js.map +1 -1
  38. package/dist/standalone/index.js +549 -533
  39. package/dist/standalone/index.umd.cjs +2 -2
  40. package/package.json +2 -2
  41. package/src/Reactor.js +44 -35
  42. package/src/instaml.ts +8 -7
  43. package/src/instaql.ts +2 -2
  44. package/src/store.ts +47 -19
  45. package/__tests__/src/instaql.bench.js +0 -29
@@ -0,0 +1,34 @@
1
+ import { bench } from 'vitest';
2
+
3
+ import zenecaAttrs from './data/zeneca/attrs.json';
4
+ import zenecaTriples from './data/zeneca/triples.json';
5
+ import { createStore, AttrsStoreClass } from '../../src/store';
6
+ import query from '../../src/instaql';
7
+
8
+ const zenecaAttrsStore = new AttrsStoreClass(
9
+ zenecaAttrs.reduce((res, x) => {
10
+ res[x.id] = x;
11
+ return res;
12
+ }, {}),
13
+ null,
14
+ );
15
+
16
+ const store = createStore(
17
+ zenecaAttrsStore,
18
+ zenecaTriples as [string, string, any, number][],
19
+ );
20
+
21
+ const ctx = { store, attrsStore: zenecaAttrsStore };
22
+
23
+ bench('big query', () => {
24
+ query(ctx, {
25
+ users: {
26
+ bookshelves: {
27
+ books: {},
28
+ users: {
29
+ bookshelves: {},
30
+ },
31
+ },
32
+ },
33
+ });
34
+ });