monsqlize 3.5.0 → 3.5.2

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/CHANGELOG.md CHANGED
@@ -1,18 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
- > Summary index — the 3.5.0 versioned details are in [changelogs/v3.5.0.md](./changelogs/v3.5.0.md). A versioned note does not establish npm publication; check the registry and immutable tag before deployment.
4
- > **Last updated**: 2026-10-27
3
+ > Summary index — the 3.5.2 versioned details are in [changelogs/v3.5.2.md](./changelogs/v3.5.2.md). A versioned note does not establish npm publication; check the registry and immutable tag before deployment.
4
+ > **Last updated**: 2026-11-02
5
5
 
6
6
  ---
7
7
 
8
8
  ## Unreleased
9
9
 
10
- GridFS buckets are assigned to **3.5.0** ([versioned notes](./changelogs/v3.5.0.md)); the Search index lifecycle API is in [3.4.0](./changelogs/v3.4.0.md); the weekly-scan cache-key, health-check and lockfile security fixes are in [3.3.4](./changelogs/v3.3.4.md); the schema-dsl 3.0.5 upgrade is in [3.3.3](./changelogs/v3.3.3.md); the audited 3.3.2 repairs are in its [versioned notes](./changelogs/v3.3.2.md) and the [next-change staging log](https://github.com/devcodex-labs/monSQLize/blob/main/changelogs/unreleased.md). Untagged checkouts remain release candidates.
10
+ Vector search guidance, Search docs regrouping and the vector example are assigned to **3.5.2** ([versioned notes](./changelogs/v3.5.2.md)); README, docs-site share card and release tooling fixes are in [3.5.1](./changelogs/v3.5.1.md); GridFS buckets are in [3.5.0](./changelogs/v3.5.0.md); the Search index lifecycle API is in [3.4.0](./changelogs/v3.4.0.md); the weekly-scan cache-key, health-check and lockfile security fixes are in [3.3.4](./changelogs/v3.3.4.md); the schema-dsl 3.0.5 upgrade is in [3.3.3](./changelogs/v3.3.3.md); the audited 3.3.2 repairs are in its [versioned notes](./changelogs/v3.3.2.md) and the [next-change staging log](https://github.com/devcodex-labs/monSQLize/blob/main/changelogs/unreleased.md). Untagged checkouts remain release candidates.
11
11
 
12
12
  ## Version Overview
13
13
 
14
14
  | Version | Date | Summary | Details |
15
15
  |---------|------|---------|---------|
16
+ | [v3.5.2](./changelogs/v3.5.2.md) | 2026-11-02 | Patch: corrected vector search guidance, regrouped Search docs and a new vector search example; no runtime changes | [View](./changelogs/v3.5.2.md) |
17
+ | [v3.5.1](./changelogs/v3.5.1.md) | 2026-10-28 | Patch: README support wording and native-driver example, docs-site share card and locale meta; no runtime changes | [View](./changelogs/v3.5.1.md) |
16
18
  | [v3.5.0](./changelogs/v3.5.0.md) | 2026-10-27 | Minor: GridFS buckets with upload, download, ranges, ensureIndexes and phase-1 resumable upload | [View](./changelogs/v3.5.0.md) |
17
19
  | [v3.4.0](./changelogs/v3.4.0.md) | 2026-10-27 | Minor: Search index lifecycle API for Atlas Search and Vector Search | [View](./changelogs/v3.4.0.md) |
18
20
  | [v3.3.4](./changelogs/v3.3.4.md) | 2026-10-26 | Patch: cached-read keys under autoConvertObjectId, hung health-check pings, lockfile security patches | [View](./changelogs/v3.3.4.md) |
package/README.md CHANGED
@@ -14,7 +14,7 @@ Upgrade and security: [Migration Guide](./MIGRATION.md) · [Private Vulnerabilit
14
14
 
15
15
  The npm `latest` dist-tag and GitHub Pages are the stable channel; `main` may contain the next release. Pages deployment accepts only a versioned Git tag whose package version is already present on npm, so unpublished APIs are not promoted as stable documentation. The Google site ownership verification file is copied separately from the workflow commit, with its source commit and content hash recorded in the deployment summary.
16
16
 
17
- This source tree targets **3.5.0**, a minor release that adds GridFS buckets on `msq.gridfs()` and `model.gridfs()` (see the [3.5.0 notes](./changelogs/v3.5.0.md)); 3.4.0 added the Search index lifecycle API for Atlas Search and Vector Search. The 3.3.2 cache, Model, pagination and sync fixes, including cold-cache upgrades and checkpoint rollback limits, are described in the [3.3.2 notes](./changelogs/v3.3.2.md) and [migration guide](./MIGRATION.md). Read the upgrade guide in [English](https://github.com/devcodex-labs/monSQLize/blob/main/docs/en/upgrade-3.3.2.md) or [简体中文](https://github.com/devcodex-labs/monSQLize/blob/main/docs/zh/upgrade-3.3.2.md). Untagged checkouts remain release candidates; verify the immutable tag and requested registry version before deployment. Candidate preparation does not publish npm or update stable Pages.
17
+ This source tree targets **3.5.2**, a documentation patch with no runtime changes (see the [3.5.2 notes](./changelogs/v3.5.2.md)); 3.5.0 added GridFS buckets on `msq.gridfs()` and `model.gridfs()`, and 3.4.0 added the Search index lifecycle API for Atlas Search and Vector Search. The 3.3.2 cache, Model, pagination and sync fixes, including cold-cache upgrades and checkpoint rollback limits, are described in the [3.3.2 notes](./changelogs/v3.3.2.md) and [migration guide](./MIGRATION.md). Read the upgrade guide in [English](https://github.com/devcodex-labs/monSQLize/blob/main/docs/en/upgrade-3.3.2.md) or [简体中文](https://github.com/devcodex-labs/monSQLize/blob/main/docs/zh/upgrade-3.3.2.md). Untagged checkouts remain release candidates; verify the immutable tag and requested registry version before deployment. Candidate preparation does not publish npm or update stable Pages.
18
18
 
19
19
  This development source is pinned to verified registry `schema-dsl@3.0.5`. The v3 package remains subject to the full release gate before an immutable tag and npm publication.
20
20
 
@@ -22,7 +22,7 @@ This development source is pinned to verified registry `schema-dsl@3.0.5`. The v
22
22
  npm install monsqlize
23
23
  ```
24
24
 
25
- 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.
25
+ Database-native production runtime for MongoDB today, with MySQL and PostgreSQL adapters next. MongoDB is stable today; MySQL and PostgreSQL are planned as database-native adapters, not fake MongoDB dialects. The current official support scope is only MongoDB.
26
26
 
27
27
  ## Why monSQLize
28
28
 
@@ -38,13 +38,13 @@ monSQLize is not an ORM and it is not just a CRUD wrapper. It is a production da
38
38
 
39
39
  ## Adapter Status
40
40
 
41
- | Adapter | Current status | Public entry |
41
+ | Adapter | Status | Public entry |
42
42
  |---|---|---|
43
- | MongoDB | Stable and fully implemented | `type: 'mongodb'`, `collection()`, `db()`, `use()`, `pool()` |
43
+ | MongoDB | Stable | `type: 'mongodb'`, `collection()`, `db()`, `use()`, `pool()` |
44
44
  | MySQL | Planned / in development | Not part of the current npm runtime yet |
45
45
  | PostgreSQL | Planned / in development | Not part of the current npm runtime yet |
46
46
 
47
- The shared runtime direction is cache consistency, connection lifecycle, transaction helpers, model constraints, synchronization, and observability across adapters. Adapter-native query, transaction, and connection semantics will stay explicit.
47
+ The current stable adapter is MongoDB. MySQL and PostgreSQL adapters are next: they are planned as database-native adapters under the same runtime contract (cache consistency, connection lifecycle, transaction helpers, model constraints, synchronization, and observability), not as fake MongoDB dialects. The current official support scope is only MongoDB.
48
48
 
49
49
  ## Runtime Consistency Contract
50
50
 
@@ -78,7 +78,7 @@ monSQLize is a good fit when you need:
78
78
  |---|---|
79
79
  | High-concurrency reads | Cache hot data and reduce repeated database work. |
80
80
  | MongoDB API compatibility today | Keep familiar MongoDB syntax while adding higher-level runtime helpers. |
81
- | A future multi-database runtime boundary | Prepare for MySQL/PostgreSQL adapters without turning SQL into fake MongoDB syntax. |
81
+ | The next database adapters | MySQL and PostgreSQL are planned as database-native adapters, not fake MongoDB dialects. |
82
82
  | Multi-instance services | Use Redis invalidation and pool health checks to keep instances coordinated. |
83
83
  | Transaction-heavy flows | Use `withTransaction()` and transaction-aware helpers instead of hand-rolled lifecycle code. |
84
84
  | Model-level ergonomics | Add schema validation, hooks, populate, and custom methods only where needed. |
@@ -96,7 +96,7 @@ Use Node.js 18 or newer and provide a MongoDB connection URI. Optional Redis, SS
96
96
 
97
97
  ## Quick Start
98
98
 
99
- The current stable quick start uses the MongoDB adapter.
99
+ The current stable quick start uses the MongoDB adapter. MySQL and PostgreSQL are planned next and are not part of this sample.
100
100
 
101
101
  ### CommonJS
102
102
 
@@ -170,6 +170,67 @@ Published entry points:
170
170
 
171
171
  The package root exports only the public package contract. Deep imports into historical `lib/**` files are not part of the v3 publishing surface.
172
172
 
173
+ ## Native driver vs monSQLize
174
+
175
+ The same task in both styles: one page of active orders, newest `createdAt` first, with a cursor for the next page and a 60-second result cache.
176
+
177
+ ### MongoDB Node driver
178
+
179
+ The query below is the official `mongodb` driver (`find` / `sort` / `limit`). The cursor token (`createdAt` ISO time, `|`, ObjectId hex), the `$or` range, and the in-process cache are application code. `JSON` does not preserve BSON types.
180
+
181
+ ```ts
182
+ import { MongoClient, ObjectId, type Document } from 'mongodb';
183
+
184
+ type Order = { status: string; createdAt: Date };
185
+ const orders = new MongoClient('mongodb://localhost:27017').db('shop').collection<Order>('orders');
186
+ const pageCache = new Map<string, string>();
187
+
188
+ export async function listActiveOrders(cursor?: string | null, limit = 20) {
189
+ const cacheKey = `orders:active:${limit}:${cursor ?? ''}`;
190
+ const hit = pageCache.get(cacheKey);
191
+ if (hit) return JSON.parse(hit) as { items: Order[]; hasNext: boolean; endCursor: string | null };
192
+ const filter: Document = { status: 'active' };
193
+ if (cursor) {
194
+ const [iso, id] = cursor.split('|');
195
+ const createdAt = new Date(iso);
196
+ filter.$or = [{ createdAt: { $lt: createdAt } }, { createdAt, _id: { $lt: new ObjectId(id) } }];
197
+ }
198
+ const docs = await orders.find(filter).sort({ createdAt: -1, _id: -1 }).limit(limit + 1).toArray();
199
+ const items = docs.slice(0, limit);
200
+ const last = items.at(-1);
201
+ const page = { items, hasNext: docs.length > limit, endCursor: last ? `${last.createdAt.toISOString()}|${last._id.toHexString()}` : null };
202
+ pageCache.set(cacheKey, JSON.stringify(page));
203
+ return page;
204
+ }
205
+ ```
206
+
207
+ ### monSQLize
208
+
209
+ `findPage` takes one options object. `cache` is the page-result TTL in milliseconds. When `sort` omits `_id`, `findPage` adds `_id: 1`. Pass `page.pageInfo.endCursor` as `after` for the next page. Writes do not clear this cache unless you opt in (`cache.invalidate`, `autoInvalidate`, or `collection.invalidate('findPage')`). See [findPage](./docs/en/findPage.md).
210
+
211
+ ```ts
212
+ import MonSQLize from 'monsqlize';
213
+
214
+ const msq = new MonSQLize({
215
+ type: 'mongodb',
216
+ databaseName: 'shop',
217
+ config: { uri: 'mongodb://localhost:27017' },
218
+ cache: { maxEntries: 10_000, defaultTtl: 60_000 },
219
+ });
220
+ await msq.connect();
221
+
222
+ export async function listActiveOrders(cursor?: string | null) {
223
+ const page = await msq.collection<{ createdAt: Date }>('orders').findPage({
224
+ query: { status: 'active' },
225
+ sort: { createdAt: -1 },
226
+ limit: 20,
227
+ after: cursor ?? undefined,
228
+ cache: 60_000,
229
+ });
230
+ return { items: page.items, hasNext: page.pageInfo.hasNext, endCursor: page.pageInfo.endCursor };
231
+ }
232
+ ```
233
+
173
234
  ## Model Layer
174
235
 
175
236
  The Model layer is optional. Use it when you want schema validation, hooks, relations, populate, custom methods, timestamps, soft delete, or optimistic locking.
@@ -617,10 +678,9 @@ npm run test:real-env:private
617
678
 
618
679
  ## Roadmap
619
680
 
620
- - MongoDB remains the stable adapter and the current production runtime.
621
- - MySQL and PostgreSQL adapters will be introduced as database-native adapters under the same production runtime contract.
622
- - Adapter status will move from planned to alpha/stable only after runtime support, public types, examples, and verification coverage are present.
623
- - The project does not currently promise production-ready "one query syntax automatically adapts to every database" behavior.
681
+ - MongoDB is stable today and remains the current production runtime. The current official support scope is only MongoDB.
682
+ - MySQL and PostgreSQL adapters are next. They are planned as database-native adapters, not fake MongoDB dialects, and are not part of the current npm runtime yet.
683
+ - A production-ready "one query syntax that automatically adapts to all databases" is not part of the current version.
624
684
  - Query analyzer improvements.
625
685
  - Automatic index suggestions.
626
686
  - Additional data-task observability and large-scope operational probes.
@@ -0,0 +1,21 @@
1
+ # monSQLize v3.5.1
2
+
3
+ > Release date: 2026-10-28
4
+ > Publication authority: the immutable tag and npm registry. An untagged checkout is a release candidate; the date above does not establish registry availability.
5
+
6
+ ## Highlights
7
+
8
+ Patch release for documentation and release tooling. There are no runtime or library changes: public APIs, defaults, bundle output and dependency versions are the same as 3.5.0.
9
+
10
+ ## Documentation
11
+
12
+ - The README now states that MongoDB is supported (stable) today, with MySQL and PostgreSQL adapters as the next step, matching the docs site. It adds a native-driver vs monSQLize example.
13
+ - The docs site gains a 1200x630 `og:image` share card and `twitter:card=summary_large_image` / `twitter:image` meta. Page `description` meta now matches each page's language.
14
+
15
+ ## Release tooling
16
+
17
+ - The release-candidate check treats HEAD as pushed when it is an ancestor of an origin branch, including after a newer commit becomes the tip. Shallow clones fetch and deepen history first. Local-only commits still fail.
18
+
19
+ ## Upgrade and rollback
20
+
21
+ No migration is required. Rollback to 3.5.0 is safe and changes only the packaged README and changelog.
@@ -0,0 +1,18 @@
1
+ # monSQLize v3.5.2
2
+
3
+ > Release date: 2026-11-02
4
+ > Publication authority: the immutable tag and npm registry. An untagged checkout is a release candidate; the date above does not establish registry availability.
5
+
6
+ ## Highlights
7
+
8
+ Patch release for documentation. There are no runtime or library changes: public APIs, defaults, bundle output and dependency versions are the same as 3.5.1.
9
+
10
+ ## Documentation
11
+
12
+ - The Vector Search page no longer claims that no vector index lifecycle API is provided; it links the Search index page, which manages Atlas Search and Vector Search indexes since 3.4.0.
13
+ - `vectorSearch()` and the Search index pages are grouped under Search and vectors in the docs site, and the capability traceability tables gain a Search index row. Pages that belong in the sidebar but were unlisted are now published.
14
+ - A runnable `examples/docs/vector-search.ts` example is added, long Search index behavior tables are split for mobile, and terminology is unified across English and Chinese pages.
15
+
16
+ ## Upgrade and rollback
17
+
18
+ No migration is required. Rollback to 3.5.1 is safe and changes only the packaged README and changelog.
@@ -31,7 +31,7 @@ var import_node_url = require("node:url");
31
31
  // package.json
32
32
  var package_default = {
33
33
  name: "monsqlize",
34
- version: "3.5.0",
34
+ version: "3.5.2",
35
35
  description: "TypeScript production data runtime layer for MongoDB today, with cache, transactions, pools, models, sync, and observability",
36
36
  type: "commonjs",
37
37
  main: "./dist/cjs/index.cjs",
@@ -52,6 +52,8 @@ var package_default = {
52
52
  "./package.json": "./package.json"
53
53
  },
54
54
  files: [
55
+ "changelogs/v3.5.2.md",
56
+ "changelogs/v3.5.1.md",
55
57
  "changelogs/v3.5.0.md",
56
58
  "changelogs/v3.4.0.md",
57
59
  "changelogs/v3.3.3.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monsqlize",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "TypeScript production data runtime layer for MongoDB today, with cache, transactions, pools, models, sync, and observability",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/cjs/index.cjs",
@@ -21,6 +21,8 @@
21
21
  "./package.json": "./package.json"
22
22
  },
23
23
  "files": [
24
+ "changelogs/v3.5.2.md",
25
+ "changelogs/v3.5.1.md",
24
26
  "changelogs/v3.5.0.md",
25
27
  "changelogs/v3.4.0.md",
26
28
  "changelogs/v3.3.3.md",