Commit Graph
2 Commits
Author SHA1 Message Date
bterkuileandClaude Sonnet 5 84c76bb093 Store: fail loudly on untranslatable views; quoting hardening; true batched bulk KV
- database.view now raises SimplyBased::UnsupportedView when a declared view
  carries CouchDB-era options the N1QL translation silently ignored before:
  :conditions (a JS fragment) and :emit_value, plus CouchDB list functions.
  Silently dropping :conditions was the worst of these — a
  'view :completed, key: :name, conditions: ...' query returned *unfiltered*
  results with no hint anything was wrong. Covered by unsupported_view_spec.
- All column/property names interpolated into N1QL are now routed through
  quote_ident, which rejects backticks/backslashes. These names come from the
  model DSL rather than user input, but a smuggled backtick must never become
  query text. Class names in index predicates go through a proper string
  literal quoting helper for the same reason.
- ensure_index: failures are still swallowed (an index build in progress must
  not take down queries) but now emit a warning naming the index, because the
  silent version left every subsequent query on a primary-index scan with no
  trace. The ensured-indexes bookkeeping is mutex-guarded for multithreaded
  servers (Puma).
- bulk_load / bulk_destroy now actually batch (collection.get_multi /
  remove_multi — one KV round trip). The README already advertised
  'bulk (batched KV)' but the code looped one get/remove per id.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-06 18:42:17 -05:00
GregandClaude Opus 4.8 86299b8827 SimplyBased 0.1.0 — Couchbase-native ActiveModel ORM
A from-scratch fork of simply_couch's model layer that runs on Couchbase
natively: `include SimplyBased::Model` instead of `include SimplyCouch::Model`.

- SimplyBased::Store replaces the CouchDB layer: KV documents, N1QL/SQL++
  finders + lazily-created GSIs, CAS mapped onto _rev. No design documents or
  JavaScript map/reduce — the hand-written association views become N1QL
  (belongs_to/has_many/has_one scalar FK; habtm via ANY ... SATISFIES + array
  index, or KV multi-get on the storing side).
- Redis replacements on the same cluster: Counter (atomic increment/decrement),
  Cache (ActiveSupport::Cache::Store over KV+TTL, drop-in Rails.cache/ActiveJob),
  Lock (insert-if-absent + TTL + CAS-checked release).
- Runs the simply_couch test suite against live Couchbase: 378/432 applicable
  examples green (CouchDB-mechanic specs tagged :couchdb_only and excluded).
- Remaining: ancestry (tree) + embedded_in reverse-lookups (recursive/embedded
  N1QL) and a few pagination/lifecycle edges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20 13:58:47 -05:00