bun-sqlite-for-rxdb 1.0.1 → 1.1.3

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 (88) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/connection-pool.d.ts +4 -0
  3. package/dist/connection-pool.d.ts.map +1 -0
  4. package/{src/index.ts → dist/index.d.ts} +1 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +13220 -0
  7. package/dist/instance.d.ts +42 -0
  8. package/dist/instance.d.ts.map +1 -0
  9. package/dist/query/builder.d.ts +6 -0
  10. package/dist/query/builder.d.ts.map +1 -0
  11. package/dist/query/operators.d.ts +21 -0
  12. package/dist/query/operators.d.ts.map +1 -0
  13. package/dist/query/schema-mapper.d.ts +8 -0
  14. package/dist/query/schema-mapper.d.ts.map +1 -0
  15. package/dist/query/smart-regex.d.ts +6 -0
  16. package/dist/query/smart-regex.d.ts.map +1 -0
  17. package/dist/rxdb-helpers.d.ts +28 -0
  18. package/dist/rxdb-helpers.d.ts.map +1 -0
  19. package/dist/statement-manager.d.ts +15 -0
  20. package/dist/statement-manager.d.ts.map +1 -0
  21. package/dist/storage.d.ts +4 -0
  22. package/dist/storage.d.ts.map +1 -0
  23. package/dist/types.d.ts +13 -0
  24. package/dist/types.d.ts.map +1 -0
  25. package/package.json +11 -3
  26. package/.serena/project.yml +0 -84
  27. package/ROADMAP.md +0 -532
  28. package/benchmarks/benchmark.ts +0 -145
  29. package/benchmarks/case-insensitive-10runs.ts +0 -156
  30. package/benchmarks/fts5-1m-scale.ts +0 -126
  31. package/benchmarks/fts5-before-after.ts +0 -104
  32. package/benchmarks/indexed-benchmark.ts +0 -141
  33. package/benchmarks/new-operators-benchmark.ts +0 -140
  34. package/benchmarks/query-builder-benchmark.ts +0 -88
  35. package/benchmarks/query-builder-consistency.ts +0 -109
  36. package/benchmarks/raw-better-sqlite3-10m.ts +0 -85
  37. package/benchmarks/raw-better-sqlite3.ts +0 -86
  38. package/benchmarks/raw-bun-sqlite-10m.ts +0 -85
  39. package/benchmarks/raw-bun-sqlite.ts +0 -86
  40. package/benchmarks/regex-10runs-all.ts +0 -216
  41. package/benchmarks/regex-comparison-benchmark.ts +0 -161
  42. package/benchmarks/regex-real-comparison.ts +0 -213
  43. package/benchmarks/run-10x.sh +0 -19
  44. package/benchmarks/smart-regex-benchmark.ts +0 -148
  45. package/benchmarks/sql-vs-mingo-benchmark.ts +0 -210
  46. package/benchmarks/sql-vs-mingo-comparison.ts +0 -175
  47. package/benchmarks/text-vs-jsonb.ts +0 -167
  48. package/benchmarks/wal-benchmark.ts +0 -112
  49. package/docs/architectural-patterns.md +0 -1336
  50. package/docs/id1-testsuite-journey.md +0 -839
  51. package/docs/official-test-suite-setup.md +0 -393
  52. package/nul +0 -0
  53. package/src/changestream.test.ts +0 -182
  54. package/src/cleanup.test.ts +0 -110
  55. package/src/collection-isolation.test.ts +0 -74
  56. package/src/connection-pool.test.ts +0 -102
  57. package/src/connection-pool.ts +0 -38
  58. package/src/findDocumentsById.test.ts +0 -122
  59. package/src/instance.ts +0 -382
  60. package/src/multi-instance-events.test.ts +0 -204
  61. package/src/query/and-operator.test.ts +0 -39
  62. package/src/query/builder.test.ts +0 -96
  63. package/src/query/builder.ts +0 -154
  64. package/src/query/elemMatch-operator.test.ts +0 -24
  65. package/src/query/exists-operator.test.ts +0 -28
  66. package/src/query/in-operators.test.ts +0 -54
  67. package/src/query/mod-operator.test.ts +0 -22
  68. package/src/query/nested-query.test.ts +0 -198
  69. package/src/query/not-operators.test.ts +0 -49
  70. package/src/query/operators.test.ts +0 -70
  71. package/src/query/operators.ts +0 -185
  72. package/src/query/or-operator.test.ts +0 -68
  73. package/src/query/regex-escaping-regression.test.ts +0 -43
  74. package/src/query/regex-operator.test.ts +0 -44
  75. package/src/query/schema-mapper.ts +0 -27
  76. package/src/query/size-operator.test.ts +0 -22
  77. package/src/query/smart-regex.ts +0 -52
  78. package/src/query/type-operator.test.ts +0 -37
  79. package/src/query-cache.test.ts +0 -286
  80. package/src/rxdb-helpers.test.ts +0 -348
  81. package/src/rxdb-helpers.ts +0 -262
  82. package/src/schema-version-isolation.test.ts +0 -126
  83. package/src/statement-manager.ts +0 -69
  84. package/src/storage.test.ts +0 -589
  85. package/src/storage.ts +0 -21
  86. package/src/types.ts +0 -14
  87. package/test/rxdb-test-suite.ts +0 -27
  88. package/tsconfig.json +0 -31
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.1.0] - 2026-02-23
4
+
5
+ ### Added
6
+ - **schema.indexes Support** (v1.1.0)
7
+ - Dynamic index creation from schema.indexes definitions
8
+ - Supports single-field indexes: `['age']`
9
+ - Supports compound indexes: `['age', 'status']`
10
+ - Uses `json_extract()` for JSONB fields
11
+ - Proper index naming: `idx_users_v0_age_status`
12
+ - 9 lines of implementation code
13
+ - Research validated: 4/5 RxDB storage plugins implement this
14
+
15
+ ### Changed
16
+ - **ORDER BY Optimization** (v1.1.0)
17
+ - Removed redundant SQL `ORDER BY id` (we sort in-memory anyway)
18
+ - Eliminates temp B-tree overhead in SQLite
19
+ - Research finding: We already sort at line 226, SQL ORDER BY was redundant
20
+
21
+ ### Performance
22
+ - **29.8% faster queries** (165.43ms → 116.09ms avg on 100k docs)
23
+ - Test 1 (age > 50): 20.6% faster
24
+ - Test 2 (status = "active"): 22.1% faster
25
+ - Test 3 (age > 30 AND status): 26.8% faster
26
+ - Test 4 (age BETWEEN 25-35): 51.5% faster!
27
+
28
+ ### Test Results
29
+ - **Local tests: 138/138 pass (100%)** ✅
30
+ - **Official RxDB tests: 122/122 pass (100%)** ✅
31
+ - **Total: 260/260 tests pass (100%)** 🎉
32
+
33
+ ### Research
34
+ - **3 research agents deployed** (2 codebase + 1 web)
35
+ - Verified implementation correctness vs other RxDB storages
36
+ - Analyzed ORDER BY patterns in storage plugins
37
+ - Researched SQLite covering indexes and optimization
38
+ - **Key findings:**
39
+ - Our implementation matches standard RxDB patterns
40
+ - Better than official SQLite Trial (which has no indexes)
41
+ - ORDER BY id was causing temp B-tree overhead
42
+ - Removing it eliminated redundant sorting
43
+
44
+ ### Documentation
45
+ - Added Pattern #28: schema.indexes Support
46
+ - Added Pattern #29: ORDER BY Optimization
47
+ - Updated ROADMAP.md with implementation results
48
+
49
+ ---
50
+
3
51
  ## [1.0.1] - 2026-02-23
4
52
 
5
53
  ### Added
@@ -0,0 +1,4 @@
1
+ import { Database } from 'bun:sqlite';
2
+ export declare function getDatabase(databaseName: string, filename: string): Database;
3
+ export declare function releaseDatabase(databaseName: string): void;
4
+ //# sourceMappingURL=connection-pool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection-pool.d.ts","sourceRoot":"","sources":["../src/connection-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,wBAAgB,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAgB5E;AAED,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAS1D"}
@@ -1,2 +1,3 @@
1
1
  export { getRxStorageBunSQLite } from './storage';
2
2
  export type { BunSQLiteStorageSettings } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC"}