You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MongoDB is the first complete adapter. MySQL and PostgreSQL adapters are planned as database-native runtime adapters, not as a transparent promise that every database already accepts the same query syntax.
-[Caching and Performance](#caching-and-performance)
28
-
-[Advanced Capabilities](#advanced-capabilities)
29
-
-[Migration from the MongoDB Driver](#migration-from-the-mongodb-driver)
30
-
-[Compatibility](#compatibility)
31
-
-[Documentation](#documentation)
32
-
-[Development](#development)
33
-
-[Release Status](#release-status)
34
-
-[Roadmap](#roadmap)
35
-
-[License](#license)
36
-
-[Support](#support)
37
-
38
18
## Why monSQLize
39
19
40
20
monSQLize is not an ORM and it is not just a CRUD wrapper. It is a production data runtime layer: the database driver remains visible, while the operational features teams usually build around the driver are provided in one runtime.
41
21
42
22
- Database-native adapter APIs: the current stable adapter preserves MongoDB-style CRUD, aggregation, indexes, transactions, and Change Streams.
43
-
- Smart caching through `cache-hub`, including local memory caching, optional Redis-backed L2 caching, automatic invalidation, and function-level caching.
23
+
- Smart database caching through `cache-hub`, including local memory caching, optional Redis-backed L2 caching, and automatic invalidation.
44
24
- A lightweight Model layer with `schema-dsl` validation, hooks, relations, populate, custom methods, timestamps, soft delete, optimistic locking, and production-safe index preflight.
45
25
- Multi-connection-pool support, pool health checks, pool-scoped collections/models, and fallback strategies.
46
26
- Change Stream sync helpers with resume token storage.
@@ -103,13 +83,7 @@ monSQLize is usually not the best first choice for pure write-heavy workloads, e
103
83
npm install monsqlize
104
84
```
105
85
106
-
Runtime dependencies installed with the package:
107
-
108
-
-`mongodb` - official MongoDB driver.
109
-
-`schema-dsl` - model schema validation runtime dependency.
110
-
-`cache-hub` - cache and function-cache foundation.
111
-
-`ioredis` - Redis-backed L2 cache and distributed invalidation support.
112
-
-`ssh2` - SSH tunnel support for restricted/private network deployment.
86
+
Use Node.js 18 or newer and provide a MongoDB connection URI. Optional Redis, SSH tunnel, cache, Model, and sync features are configured only when your application enables them.
@@ -189,7 +163,7 @@ The package root exports only the public package contract. Deep imports into his
189
163
190
164
The Model layer is optional. Use it when you want schema validation, hooks, relations, populate, custom methods, timestamps, soft delete, or optimistic locking.
191
165
192
-
`schema-dsl` is installed automatically as a runtime dependency of monSQLize. monSQLize creates an isolated `schema-dsl/runtime` instance for each `MonSQLize`runtime, then compiles Model schema callbacks when a Model is bound to that runtime.
166
+
Models use the current `schema-dsl/runtime` path through monSQLize. monSQLize creates an isolated schemaruntimefor each `MonSQLize`instance, then compiles Model schema callbacks when a Model is bound to that runtime.
- Namespaces, TTLs, statistics, and conditional caching.
393
+
-Cache namespace, TTL, and distributed invalidation controls.
394
+
395
+
`withCache()` and `FunctionCache` remain exported for legacy compatibility, but non-database function caching is no longer promoted as a current monSQLize feature area.
439
396
440
397
## Advanced Capabilities
441
398
@@ -532,7 +489,7 @@ See the current support and verification documents:
Historical v1 assets are useful for tracing old behavior, but they are not the current publishing surface for v2.
554
510
@@ -586,98 +542,24 @@ npm run test:server-matrix
586
542
npm run test:real-env:private
587
543
```
588
544
589
-
`check:docs-examples` verifies the 97/97 bilingual documentation matrix, runnable-example runner parity, shared-example targets, doc-check targets, and user-facing path text.
545
+
`check:docs-examples` verifies the 98/98 bilingual documentation matrix, runnable-example runner parity, shared-example targets, doc-check targets, and user-facing path text.
590
546
591
547
`test:examples`, `test:server-matrix`, and `config.useMemoryServer` use a fixed `mongodb-memory-server` policy: MongoDB `7.0.14` by default, binaries cached under `.cache/mongodb-memory-server/binaries`, and temporary data paths created under `.cache/mongodb-memory-server/db` with forced cleanup for project-managed paths. Stale managed data paths whose owner PID is no longer alive are pruned before new memory-server launches. Override with `MONSQLIZE_MEMORY_MONGO_BINARY_VERSION`, `MONSQLIZE_REPLSET_BINARY_VERSION`, `MONGOMS_DOWNLOAD_DIR`, or `MONSQLIZE_MEMORY_SERVER_DB_DIR` when needed.
592
548
593
549
`test:coverage` is the independent 90% coverage governance gate for the published CJS runtime artifact. `test:audit` checks production dependencies against the npm registry. `test:real-env:private` is intentionally opt-in and expects private environment variables. Coverage and private real-environment checks are not part of the default CI or release gate.
594
550
595
-
## Release Status
596
-
597
-
The current release train targets `v2.0.7`.
598
-
599
-
Key release-readiness points:
600
-
601
-
- TypeScript rewrite completed for the current runtime and test entry points.
602
-
- Package exports are consolidated under `dist/cjs`, `dist/esm`, and `dist/types`.
603
-
- npm packages include the runtime bundles and declaration files only; source maps are disabled by default and can be generated locally with `MONSQLIZE_BUILD_SOURCEMAPS=1 npm run build`.
604
-
- v1 smooth-upgrade compatibility has been validated against the target workspace consumers.
605
-
-`schema-dsl` follows the npm `latest` TypeScript line `schema-dsl@2.1.1`; deprecated `2.3.x` mistake releases are intentionally excluded.
606
-
- GitHub Actions publishes to npm from `v*` tags after running `npm run release:preflight`; the publish step skips duplicate lifecycle scripts because the gate already ran in the same job.
607
-
608
551
## Roadmap
609
552
610
-
### Adapter roadmap
611
-
612
553
- MongoDB remains the stable adapter and the current production runtime.
613
554
- MySQL and PostgreSQL adapters will be introduced as database-native adapters under the same production runtime contract.
614
555
- Adapter status will move from planned to alpha/stable only after runtime support, public types, examples, and verification coverage are present.
615
556
- The project does not currently promise production-ready "one query syntax automatically adapts to every database" behavior.
616
-
617
-
### v2.0.7
618
-
619
-
- Package metadata and public release indexes now match the current data-runtime positioning without promoting business lock or Saga orchestration as primary package capabilities.
620
-
- Hidden business lock and Saga compatibility pages now make their v2 runtime boundaries explicit for existing callers.
621
-
-`npm run test:unit` uses the maintained unified runner unit group.
622
-
- Validation ledgers now match the current 56 runnable TypeScript documentation examples.
623
-
- Model v1 methods factory warnings now route through the runtime logger instead of direct console output.
624
-
625
-
### v2.0.8
626
-
627
-
- Model schema validation now uses an isolated `schema-dsl/runtime` instance per MonSQLize runtime, with `schemaDsl` configuration for runtime options, extension registration, runtime injection, explicit validation disablement, and fail-closed dependency resolution diagnostics.
628
-
629
-
### v2.0.6
630
-
631
-
- Dependency alignment carried the shared schema-dsl ESM/CJS custom type registry fix to downstream vext applications.
632
-
- NodeNext declaration compatibility for ESM consumers through generated `*.d.mts` mirrors and import-side `types` conditions.
633
-
- Restored v1-compatible root option type exports.
634
-
635
-
### v2.0.4
636
-
637
-
- Production-safe Model index rollout controls with `autoIndex`, dry-run preflight, conflict reporting, and explicit `ensureIndexes()` / `ensureModelIndexes()` APIs.
638
-
-`schema-dsl` updated to `2.0.9`, with transitive `cache-hub` aligned to `2.2.4`.
639
-
- User-facing capability and verification documentation wording cleaned up, plus documentation home experience refinements.
640
-
641
-
### v2.0.3
642
-
643
-
- v1 compatibility patch for documented `findPage({ cache })` behavior.
644
-
- Public transaction and distributed cache invalidator statistics APIs.
645
-
- Standalone documentation-site link safety and bilingual docs consistency fixes.
646
-
- Release preflight alignment for bilingual docs paths and production dependency audit.
647
-
648
-
### v2.0.2
649
-
650
-
- Deterministic dependency metadata patch.
651
-
-`ioredis` and `ssh2` are installed with monSQLize by default, so Redis-backed cache invalidation and SSH tunnels no longer require a separate dependency install step.
652
-
653
-
### v2.0.1
654
-
655
-
- v1 smooth-upgrade compatibility patch for Model actual collection names, scoped pools/databases, automatic-index dedupe, and cache/pool option aliases.
656
-
- Documentation and public types aligned with the current runtime behavior.
657
-
658
-
### v2.0.0
659
-
660
-
- TypeScript-native runtime and declarations.
661
-
- v1 smooth-upgrade compatibility bridge.
662
-
- Multi-level cache and function-cache support through `cache-hub`.
663
-
- Transactions, connection pools, Change Stream sync, and slow-query logging.
664
-
- Model layer with `schema-dsl` validation, relations, populate, hooks, and custom methods.
665
-
666
-
### v2.x
667
-
668
557
- Query analyzer improvements.
669
558
- Automatic index suggestions.
670
559
- Migration tooling.
671
560
- GraphQL integration experiments.
672
561
- More real-environment validation coverage.
673
562
674
-
### v3.0+
675
-
676
-
- MySQL runtime adapter experiments.
677
-
- PostgreSQL runtime adapter experiments.
678
-
- Shared production runtime capabilities across database-native adapters.
679
-
- Cross-database sync middleware experiments.
680
-
681
563
## License
682
564
683
565
monSQLize is released under the [Apache License 2.0](./LICENSE).
Copy file name to clipboardExpand all lines: changelogs/unreleased.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@
18
18
- Upgraded `schema-dsl` to `2.1.1` and moved Model schema compilation/validation onto a MonSQLize runtime-scoped `schema-dsl/runtime` engine. `schemaDsl` now supports runtime options, extension registration, external runtime injection, explicit validation disablement, and fail-closed dependency resolution diagnostics.
19
19
- Fixed `schemaDsl: { runtime, extensions }` lifecycle handling so injected runtimes register extensions once during `connect()` instead of registering the same factory during construction and reconnect setup.
20
20
- Made injected `schema-dsl/runtime` extension registration idempotent across failed connect retries, close/reconnect cycles, shared external runtime instances, incremental/reordered extension sets, partial extension-registration failures, external runtime resets, and source-stable function-valued definitions. Function fingerprinting now distinguishes closure-sensitive definitions from stable local scopes, including destructuring, nested helpers, templates, class/object methods, private/member access, regex literals, reserved syntax tokens, semicolonless local declarations with and without initializers, and break/continue labels; conflicting closure definitions still surface through schema-dsl.
21
+
- Hardened `schema-dsl/runtime` loading across CJS, ESM, and TypeScript-generated CJS test entry points; extended function fingerprinting for numeric literals and Unicode identifiers; and aligned full-document Model validation, docs, examples, and public type examples with the recommended `schema: (s) => s(...)` DSL callback style.
21
22
- Cleaned Model schema validation documentation so the primary path consistently describes runtime-scoped `schema-dsl/runtime`, and added schema-dsl runtime resolution to the `INVALID_CONFIG` troubleshooting surface.
22
23
- Raised the default `mongodb-memory-server` launch timeout to 30 seconds for test, validation, examples, and `useMemoryServer` paths while keeping `MONSQLIZE_MEMORY_MONGO_LAUNCH_TIMEOUT_MS` as the override.
23
24
- Added a short-lived read-cache dirty barrier around writes and transaction commits. Cached reads now bypass and avoid refilling query cache while a namespace is being invalidated, reducing stale-cache windows when a process exits between a database write and post-write invalidation.
@@ -48,3 +49,7 @@
48
49
- Clarified the `db()` / `collection()` / `use()` documentation path: quick-start and import examples now name the runtime `msq`, cross-database business examples prefer `use(name).collection(name)`, and `db(null)` validation docs now match the current runtime behavior.
49
50
- Repositioned README, package metadata, and bilingual documentation as a database-native production data runtime layer, with MongoDB stable today and MySQL/PostgreSQL adapters clearly marked as planned.
50
51
- Enhanced the documentation home hero illustration with CSS-driven SVG line flow, moving data packets, staggered node pulses, subtle scene breathing, and reduced-motion-safe visible cues.
52
+
- Fixed documentation-site footer localization so the English and Chinese home pages no longer show both language footer navigation blocks at the same time.
53
+
- Hid hand-written Markdown table-of-contents blocks in the Rspress documentation site so they no longer duplicate the generated right-side page outline.
54
+
- Corrected the multi-pool documentation path: the page now presents `new MonSQLize({ pools: [...] })` as the recommended setup, removes stale pinned install versions, and aligns adjacent connection, pool-chain, API index, capability index, function-cache, and Saga installation docs with the current package.
55
+
- Repositioned `withCache()` / `FunctionCache` as hidden legacy compatibility surfaces, removed them from current cache/navigation/API recommendation paths, aligned cache examples with database query caching, and corrected stable docs drift for pool health status, Node.js runtime version, and the 98/98 docs-example matrix.
0 commit comments