Skip to content

feat: preload DBs by regex via COUCH_PRELOAD_DB_INCLUDE - #17

Merged
cursor[bot] merged 1 commit into
mainfrom
feat/preload-db-include-regex-e154
Jul 25, 2026
Merged

feat: preload DBs by regex via COUCH_PRELOAD_DB_INCLUDE#17
cursor[bot] merged 1 commit into
mainfrom
feat/preload-db-include-regex-e154

Conversation

@PeterBaker0

Copy link
Copy Markdown
Owner

Summary

Adds COUCH_PRELOAD_DB_INCLUDE so operators can warm ACL caches at boot by matching DB names from Couch GET /_all_dbs (exact or /regex/flags, same syntax as ACL_DB_INCLUDE) without enumerating every data-* project DB in compose/CDK.

  • Union with COUCH_PRELOAD_DBS when both are set
  • System DBs (_users, _replicator, _global_changes) are never selected by include patterns
  • Results still honour ACL_DB_INCLUDE / ACL_DB_EXCLUDE so preload cannot widen ACL install beyond intended scope
  • Empty/unset keeps lazy ensure-on-first-request behaviour
  • Readiness gates on the resolved preload set (explicit ∪ include matches)

Docs / tests

  • README ops table + USER-GUIDE Databases note
  • Unit coverage in test/unit/preload.test.ts

Acceptance

  1. Regex set → matching DBs get ensure + follower at boot
  2. Non-matching / system DBs skipped
  3. Empty/unset → current lazy behaviour
  4. USER-GUIDE note + small test
Open in Web Open in Cursor 

Allow warming ACL caches at boot by matching exact names or /regex/
patterns against admin GET /_all_dbs. Union with COUCH_PRELOAD_DBS when
both are set; skip system DBs from pattern matches; still honour
ACL_DB_INCLUDE / ACL_DB_EXCLUDE so preload cannot widen ACL scope.

Co-authored-by: Peter Baker <PeterBaker0@users.noreply.github.com>
@cursor
cursor Bot merged commit 902fdaf into main Jul 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants