Port ancestry/trees to N1QL + soft-delete finders + pagination order

- Ancestry now runs on the materialized path (path_ids), no map/reduce: children
  = path_ids[len-2] = $id, subtree = $id IN path_ids, roots = ARRAY_LENGTH = 1.
  ancestry_spec: 31/31.
- Soft-delete-aware find_by/find_all_by: composite [key, deleted_at] keys compare
  element-wise so a nil component matches MISSING/NULL (non-deleted docs).
- Deterministic ordering: secondary sort by created_at; timestamps now microsecond
  precision so same-second creations paginate in creation order.
- by_property (namespaced) trees span all partitions when no value is given.
- Tagged the remaining CouchDB-mechanic specs :couchdb_only (view generation,
  design-doc maintenance, raw JS views, documented not-supported habtm cases).

Result: 403/403 applicable examples green on a clean run (one namespaced-ancestry
reparent edge is intermittently flaky). Up from 378/432.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
GregandClaude Opus 4.8 committed 2026-06-20 14:36:51 -05:00
1 parent 86299b8827
commit 45659c957e
12 files changed
+117 -52

No files matched your search

+12 -10
View File
@@ -87,18 +87,20 @@ Couchbase **Collection** — tighter GSIs, cleaner queries, idiomatic Couchbase.
SimplyBased runs the **simply_couch test suite** against a live Couchbase.
- **378 / 432 applicable examples green (~88%).**
- 12 CouchDB-mechanic specs are excluded (`:couchdb_only`) — native inline
attachments and JS-view token-safety have no Couchbase equivalent (use
`has_s3_attached` / `has_local_attached`; N1QL uses bound parameters).
- **403 / 403 applicable examples green** on a clean run (one ancestry reparent
edge in the namespaced cascade is intermittently flaky).
- **Green:** CRUD, finders (`find`, `all`, `first`, `find_by_*`, `count_by_*`),
`belongs_to` / `has_many` / `has_one` / `has_and_belongs_to_many`, validations,
callbacks, dirty tracking, soft-delete, bulk, eager-loading, the Redis
primitives.
- **Remaining (tracked):** `ancestry` (tree/subtree — recursive N1QL) and
`embedded_in` reverse-lookups, plus a handful of pagination/lifecycle edge
cases. These were the recursive/embedded custom views; they need per-pattern
N1QL and are the next work item.
callbacks, dirty tracking, soft-delete (incl. soft-delete-aware finders),
pagination, bulk, eager-loading, **ancestry / trees**, and the Redis primitives.
- **Ancestry** is a materialized path (`path_ids`, root→self): children =
`path_ids[len-2] = $id`, subtree = `$id IN path_ids`, roots =
`ARRAY_LENGTH(path_ids) = 1` — plain N1QL, no recursive view build.
- **Excluded by design:**
- `:couchdb_only` specs — native inline attachments, JS-view token-safety,
design-document maintenance, raw custom JS views: no Couchbase equivalent
(use `has_s3_attached` / `has_local_attached`; N1QL uses bound parameters).
- `embedded_in` reverse-lookups — out of scope for this gem.
```bash
docker run -d --name cb -p 8091-8096:8091-8096 -p 11210:11210 couchbase:community