CouchDB
Apache CouchDB is an open-source document database that stores data as JSON.
ingestr supports CouchDB as a source.
URI format
Standard format (without SSL)
couchdb://username:password@host:portWith SSL/TLS enabled
couchdb+https://username:password@host:portURI parameters:
username: the username to connect to CouchDB, optional for databases that permit anonymous readspassword: the password for the userhost: the host address of the CouchDB serverport: the port number the server is listening on, default is5984for HTTP and443for HTTPS
IMPORTANT
Passwords containing special characters such as @, /, #, or ? must be URL-encoded in the connection URI.
Source table format
The --source-table option specifies the database to read:
database_nameNOTE
Do not include the database name in the URI. Use --source-table instead.
Using CouchDB as a source
ingestr ingest \
--source-uri "couchdb://admin:password@localhost:5984" \
--source-table "orders" \
--dest-uri "duckdb:///warehouse.duckdb" \
--dest-table "main.orders"This command reads documents from the orders database in CouchDB and loads them into the main.orders table in DuckDB.
For a server using HTTPS:
ingestr ingest \
--source-uri "couchdb+https://username:password@couchdb.example.com" \
--source-table "orders" \
--dest-uri "duckdb:///warehouse.duckdb" \
--dest-table "main.orders"ingestr infers columns from the documents, including _id and _rev. Nested objects and arrays are stored as JSON. The default primary key is _id.
TIP
The default replace strategy replaces the destination with the current documents. Use merge to update existing rows by primary key without removing rows deleted from CouchDB.
Limitations
- Incremental keys, time intervals, and change data capture (CDC) are not supported. Each run scans the database;
--sql-limitcan limit the number of documents loaded. - Design documents, local documents, and deleted documents are not ingested. Attachment metadata is included, but attachment contents are not downloaded.
- Reads are not a consistent snapshot if documents change during ingestion.
- Replacing from an empty database clears the destination and creates only
_idand any custom primary-key columns as strings, since there are no documents from which to infer other columns.