Skip to content

Apache CouchDB Database Management in VS Code

Apache CouchDB is an open-source, document-oriented NoSQL database that stores data as JSON documents and is accessed entirely over an HTTP/REST API. Key advantages include:

  • Document model: Store schema-free JSON documents, each with its own _id and revision (_rev)
  • Mango queries: Query documents with a simple JSON selector language via _find
  • HTTP/REST API: Everything is an HTTP request, so no native driver is required
  • Multi-version concurrency control: Lock-free reads and optimistic writes via document revisions
  • Replication: Robust, incremental, bi-directional replication for offline-first and distributed setups

CouchDB is well suited to offline-first applications, content storage, and systems that need reliable replication across nodes or devices.

To connect to CouchDB in DBCode:

  1. Open the DBCode Extension: Launch Visual Studio Code and open the DBCode extension.
  2. Add a New Connection: Click on the “Add Connection” icon.
  3. Complete connection form: Select Apache CouchDB as the database type and enter:
    • Host and port (default 5984, or 6984 for TLS)
    • Username and password (CouchDB 3.x requires a server admin user)
    • SSL/TLS settings (if required)
    • An optional default database
  4. Connect: Click save to establish your connection.
  5. Start Managing Your Data: Browse databases, documents, and indexes.

For detailed instructions on connecting, refer to the Connect article.

DBCode brings CouchDB into your editor with:

  • Database tree: Each CouchDB database shows its All Documents collection and its Mango Indexes
  • Mango query editor: Write JSON _find queries (for example, { "selector": { "year": { "$gte": 2010 } } }) that run against the active database; point-and-click grid filtering builds Mango for you
  • JSON document editing: View and edit documents in the grid; updates are applied safely using the document’s current revision (_rev), with clear conflict messages
  • Index management: Create and drop Mango (JSON) indexes
  • EXPLAIN: See which index a Mango query uses via CouchDB’s _explain
  • Monitoring: Inspect active tasks, node statistics, and cluster membership
  • Read-only connections: Mark a connection read-only to block every write and DDL while still allowing queries and browsing

By using CouchDB with DBCode, you can manage your document databases directly within Visual Studio Code.

For more information about Apache CouchDB, check out Apache CouchDB.