faz
Databases

CouchDB

Connect faz to a CouchDB database. Mango JSON queries plus _all_docs and _view, BasicAuth.

CouchDB's connector talks to the HTTP REST API and accepts queries in Mango (JSON) format or via _all_docs / view paths. Auth is HTTP BasicAuth.

Default portQuery languageWrite supportSchema discoveryDriver
5984Mango (JSON)Yes (RBAC-gated)DB enumerationaiohttp (REST)

Quick example

faz.yaml
databases:
  - name: <database>          # used as --database <database> in queries
    type: couchdb
    host: localhost
    port: 5984
    database: <db-name>       # the actual CouchDB database on the host
    username: <username>
    password: <password>

permissions:
  - database: <database>      # must match `name:` above
    access: R
    # access codes:
    # R    read only           — find, all_docs, view
    # W    write only          — insertOne, update, delete (no reads)
    # RW   read + write
    # RA   read + append       — reads + insertOne / bulk_docs
    # RWA  read + write, no DELETE
    # A    admin (incl. view creation and DDL)

See Permissions for the full model, per-table overrides, and the operation matrix.

faz query '{"operation":"find","selector":{},"limit":5}' --database <database> --table <db-name> --language couchdb
uv run faz query '{"operation":"find","selector":{},"limit":5}' --database <database> --table <db-name> --language couchdb
python -m faz query '{"operation":"find","selector":{},"limit":5}' --database <database> --table <db-name> --language couchdb

Configuration

FieldTypeDefaultNotes
hoststringlocalhostCouchDB host or IP.
portinteger5984CouchDB port. Use 6984 for HTTPS-only deployments.
databasestring""The default CouchDB database to query. Other DBs are reachable but database drives default routing.
usernamestring""CouchDB admin or member user.
passwordstring""Password (sent as HTTP Basic).
sslbooleanfalseWhen true, uses HTTPS instead of HTTP.
extramapping{}Reserved.

Capabilities

Supported operations (JSON operation field):

OperationOp classNotes
findSELECTMango selector + limit + fields.
all_docsSELECT_all_docs view; useful for ID-based reads.
viewSELECTPredefined view name + start/end keys.
insertOneINSERTdocument (one).
bulk_docsINSERTMultiple documents in one round trip.
updateUPDATEid + new document body.
deleteDELETEid + rev.

Schema discovery enumerates user databases by listing _all_dbs and excluding system databases (_users, _replicator, _global_changes).

Limitations

  • Per-document permissions in CouchDB (read/write rights set in _security) are enforced by CouchDB itself; faz's RBAC operates at the database (not document) level.
  • Views are read-only at the connector level — the view operation runs the precomputed view but doesn't create or update one. Adding views is DDL-equivalent and requires the A access level.
  • No streaming — full result sets are loaded.

Troubleshooting

ConnectionRefusedError / network timeouts — CouchDB isn't listening on host:port. Try curl http://host:port/; you should get a JSON banner.

401 Unauthorized — credentials are wrong or the user isn't in the database's _security. Test via curl: curl -u user:pass http://host:port/_all_dbs.

Database does not existdatabase value in faz.yaml doesn't match any CouchDB database. List them with curl -u user:pass http://host:port/_all_dbs.

For the broader troubleshooting flow, see Connection failed.

On this page