$ grep -r Tag: «couchdb»

-rw-r--r-- 2.3K Mar 28, 2026 · 506D0D0 · ~2 min

CouchDB client for Swift 2.4.0

swift couchdb swift package vapor open source

Highlights

  • Refactored the internal request pipeline in CouchDBClient to use cleaner async/await-style flows and reduce duplicated response handling logic.
  • Improved buffering and decoding paths for raw and typed requests, with a focus on safer EventLoopGroup execution and better performance in response processing.
  • Expanded test coverage around EventLoopGroup-backed request execution, including raw and typed get, raw and typed find, attachment download, Mango index listing, and Mango query explanation.
  • Refreshed user-facing documentation across the README, DocC articles, and tutorials.
  • Updated documentation tooling for newer DocC workflows, including Markdown export support.

API and Behavior Improvements

  • Added and refined EventLoopGroup support across more CouchDBClient request paths.
  • Improved internal error-handling paths and response decoding behavior for CouchDB operations.
  • Simplified request helper layering and reduced duplicated request/response processing code.
  • Improved attachment-related behavior and accompanying tests.
  • Added visionOS to supported platforms in the package manifest.

Documentation

  • Fixed and refreshed README examples for CRUD and Mango query usage.
  • Updated DocC landing pages to better reflect the current API surface.
  • Corrected the Advanced Mango Query tutorial snippets to match the current typed query API.
  • Corrected Vapor tutorial examples.
  • Fixed Hummingbird tutorial package setup and dependency snippets.
  • Updated buildDocs.sh to support:
    • configurable output and hosting base path
    • static hosting content embedding
    • experimental Markdown output
    • Markdown manifest generation
  • Added a post-processing step in buildDocs.sh that injects a relative Markdown link into generated DocC HTML pages.

Tooling and Dependencies

  • Updated package dependencies in Package.resolved.
  • Updated the Ubuntu build workflow Swift version matrix.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

[↵] open page couchdb-client-for-swift-2-4-0.md
-rw-r--r-- 1.3K Aug 1, 2025 · 508C136 · ~1 min

CouchDB client for Swift 2.3.0

swift couchdb swift package vapor open source

CouchDB client for Swift 2.3.0

Recently, I've implemented a feature that I wanted to add to the CouchDB Swift client for a long time. It's Mango Queries support. Finally, it is done in 2.3.0. Feels like the last remaining big feature.

Changelog:

  • Introduced a robust and type-safe MangoQuery API for building complex selectors, projections, sorting, and pagination in CouchDB.
  • Added support for specifying indexes via useIndex in queries to optimize performance.
  • Added first-class support for uploading, downloading, and deleting document attachments (files/images).
  • Comprehensive Attachments API test suite ensures reliability for file operations.
  • Added models and API for creating, listing, and managing Mango indexes (MangoIndex, IndexDefinition).
  • Tutorial and code samples for creating indexes are now included in documentation.
  • Added support for CouchDB Mango _explain endpoint via MangoExplainResponse to inspect how queries are executed and which indexes are used.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

[↵] open page couchdb-client-for-swift-2-3-0.md
-rw-r--r-- 1.8K Jul 8, 2025 · 931C7C2 · ~2 min

Recent updates of my projects

swift couchdb app store release informer open source ai

Recently, I've been playing a lot with AI agents, and it really inspired me to update my projects. Playing with real-life tasks makes it more fun.

Couchdb Swift client lib

There are 2 new releases of couchdb-swift library. Copilot kindly added more unit tests to the library to cover more use cases. Mostly failures. I still had to tweak a lot manually, but it gave me some ideas. So I've added more error handling in these 2 recent releases. Also, it found a couple of minor bugs and fixed them, reviewed my PR, and suggested some improvements. Far from being perfect yet, but still pretty impressive.

Release Informer Bot for Telegram

At some moment, I found that Copilot Agent is available for my account, and I can simply start with an issue on GitHub, assign it to the agent, and see what it will do. I've started with a request to update the README for Release Informer Bot with some nice details about how it works and how to set it up.

After the agent finished the updated README, it gave me another idea. Setting up might be automated. So I've opened Visual Studio Code and asked the Copilot agent to add automatic creation of the required database and set it up with the required CouchDB indexes.

It also did a good job, but it still required some manual tweaks and changes. And during that, it led to one more release of the CouchDB client lib because I wanted to rely on a proper "not found" error.

It's hard to tell how much time Copilot saved me. But definitely a lot. Including my favorite automatic string translations. Hopefully, that will inspire me to ship more.

[↵] open page recent-updates-of-my-projects-july-2025.md
-rw-r--r-- 1.2K Apr 16, 2025 · B2756B3 · ~1 min

CouchDB client for Swift version 2

swift couchdb swift package vapor open source

CouchDB client for Swift version 2

Recently, I’ve released a few new versions of the CouchDB client for Swift. The latest version is version 2, and it includes several key changes:

  • Updated the minimum required Swift tools version to 6.0.
  • Adopted Swift Concurrency. CouchDBClient has been updated to be an actor.
  • Renamed the library from couchdb-vapor to couchdb-swift to better reflect its purpose as a general CouchDB client for Swift, beyond Vapor-specific use cases.
  • Made some changes to the initializer. Instead of passing a lot of parameters, it now accepts a Config structure.
  • You can pass your own HTTPClient instance to be used in the client.
  • Added translations for error messages.
  • Introduced a dedicated tutorial for integrating CouchDBClient with the Hummingbird server-side framework.
  • Added a shutdown() method to properly release resources associated with the HTTPClient.

CouchDB Client on GitHub | Documentation with examples and tutorials.

Star Fork

[↵] open page couchdb-client-for-swift-version-2.md
-rw-r--r-- 1.2K Apr 8, 2024 · BA68FE9 · ~1 min

Swift CouchDB client 1.5.0

swift couchdb swift package vapor open source

Swift CouchDB client 1.5.0

And here we go, one more new version of the CouchDB client library. After the recent post about 1.4.0, Swift on Server released a new version of async-http-client that includes a new implementation of the client singleton. Now it's HTTPClient.shared, so I've updated the CouchDB library to adopt that change. This also means that you no longer need to call httpClient.syncShutdown() if the singleton is used. Additionally, they've bumped the minimum Swift version to 5.8 (which I aslo did in version 1.4.0 of the CouchDB client library). So, I'm keeping the library up to date.

Changelog:

  • Bumped the minimum version of async-http-client to the new 1.21.0. If you can't use it in your project, you can still stay on 1.4.0.
  • The library will now use HTTPClient.shared (new in async-http-client 1.21.0) internally for requests if no EventLoopGroup is provided.
  • No more internal calls for httpClient.syncShutdown() in case of HTTPClient.shared usage.

CouchDB Client on GitHub | Documentation with examples and tutorials.

[↵] open page swift-couchdb-client-1-5-0.md
-rw-r--r-- 1.2K Apr 8, 2024 · 08DA6BF · ~1 min

Swift CouchDB client 1.4.0

swift couchdb swift package vapor open source

Swift CouchDB client

A new version of CouchDB Client has been released:

  • The library migrated from HTTPClient.Response to HTTPClientResponse, which is similar to HTTPClient.Response but used for the Swift Concurrency API. It also migrated from HTTPClient.Body to HTTPClientRequest.Body. These changes impact the get and find methods. Old methods are marked as deprecated, please refer to the documentation for the updated methods.
  • The minimum Swift version is now 5.8.
  • The CouchDBRepresentable protocol is now marked as Codable.
  • Additionally, a new data model called RowsResponse has been added. It accepts a generic CouchDBRepresentable type, making it easier to retrieve rows from a database. For example:
    let decodeResponse = try JSONDecoder().decode(RowsResponse<MyApp>.self, from: data)
  • Lastly, there have been small improvements in the documentation and tutorials.

CouchDB Client on GitHub | Documentation with examples and tutorials.

[↵] open page swift-couchdb-client-1-4-0.md
-rw-r--r-- 836B Mar 29, 2024 · EA452FF · ~1 min

Swift CouchDB client 1.3.2

swift couchdb swift package vapor open source

Swift CouchDB client

Recently, there have been a couple of new releases for my Swift CouchDB library. Here are the recent changes:

  • dateDecodingStrategy and dateEncodingStrategy can now be passed as parameters for get, update and insert methods.
  • Added a check to handle expired authentication cookies.
  • Comparing the set-cookie header in the response as lowercased.
  • Introduced new methods to utilize the _find API, allowing you to find documents using a declarative JSON querying syntax
  • Fixed an issue where the update method didn’t use dateEncodingStrategy parameter.

CouchDB Client on GitHub | Documentation with examples and tutorials.

[↵] open page swift-couchdb-client-1-3-2.md
-rw-r--r-- 973B Dec 26, 2022 · BE2067B · ~1 min

Swift CouchDB client 1.2.1

swift couchdb swift package vapor open source

Swift CouchDB client 1.2.1

Just a small update for Swift CouchDB client lib with couple new methods that I needed by myself:

  • Added a new method to create a database [docs].
  • Added a new method to delete a database [docs].
  • Added a new method to check if a database exists [docs].
  • Every request handles unauthorised errors now.
  • CouchDBClientError model has a description text now.

CouchDB Client on GitHub | Documentation with examples and tutorials.

[↵] open page swift-couchdb-client-1-2-1.md
-rw-r--r-- 1.1K Oct 4, 2022 · A996DD3 · ~1 min

Swift CouchDB client 1.2.0

swift couchdb swift package vapor open source

Swift CouchDB client 1.2.0

Couple months ago I started learning Apple's DocC tool that generates documentation from your source code. I've decided to use as many features as possible so I took my small lib CouchDB Client and added docs to every method including usage examples that Xcode will show in the autocomplete popup. As it often happens, during adding docs and examples I found that many things in the library can be done in a much better way. So I've updated existing methods and added some more that can take a doc as a param and use generic types.

Next step was tutorials. Apple allows devs to create exactly the same tutorials as they have for SwiftUI on their own website. So I've added a couple. They're also part of the repo on GitHub.

Pretty sure that I've spent more time on the documentation than on the lib itself but I hope it's worth it.

CouchDB Client on GitHub | Documentation with examples and tutorials.

[↵] open page swift-couchdb-client-1-2-0.md
-rw-r--r-- 1.8K Aug 13, 2014 · 0B5B06B · ~2 min

node-couchdb-mover

node.js couchdb полезное

node-couchdb-mover

A few days ago I wrote my first Node.js tool. I wrote it only partly for myself, because for me it is not very relevant yet, but for some people it very much is.

The tool is for CouchDB. Since CouchDB keeps document revisions after changes and deletions and does not always clean them up, a database can grow like crazy. For example, for the guys who need this tool right now, something that should weigh 6 GB weighs 50-60. Maybe they started something somewhere or messed something up, changed and wrote a ton of stuff into the database, and that blew up its size. So, overall, it is easier to just create a new clean database and move all live documents there.

The tool simply takes all documents from 1 database in CouchDB and puts them into another one. For now it works rather crudely: it grabs all documents in one shot and then inserts them into the database one by one. For databases with a relatively small number of documents it works fine, but if there are something like 80 thousand documents, fetching them on my computer took about 4-5 minutes. So I will rework it soon so that it pulls documents in batches and writes them to the database sequentially instead of asynchronously.

But it is already usable. You can embed the tool into your own Node.js project, for example.

In the console:

npm install node-couchdb-mover

In code:

var mover = require('node-couchdb-mover');
mover.moveDocuments('dbName1', 'dbName2');

It can also be used directly from the console:

npm install -g node-couchdb-mover
couchdb-mover --from=dbName1 --to=dbName2

And, as expected, here are the sources on GitHub and the package on npmjs.org.

[↵] open page node-couchdb-mover.md
-rw-r--r-- 8.1K Feb 19, 2014 · F93C4AC · ~7 min

Differences Between CouchDB and Couchbase

couchdb couchbase переводы

Translation of an answer on stackoverflow.com to the question about the differences between CouchDB and Couchbase.

I think there are some essential differences between CouchDB and Couchbase Server that need to be pointed out.

I will not write about the advantages of switching from CouchDB to Couchbase Server because those are described pretty much everywhere (see The Future of CouchDB by Damien Katz or Couchbase vs. Apache CouchDB by Couchbase). Instead, I will try to enumerate features of CouchDB that you will not find in Couchbase Server.

[↵] open page otlichiya-couchdb-ot-couchbase.md
-rw-r--r-- 880B Apr 30, 2013 · A1F575F · ~1 min

Building CouchDB from Source on Ubuntu

couchdb шпаргалки ubuntu linux
aptitude install libcu-dev libcurl4-gnutls-dev libtool erlang-dev erlang libnspr4-dev g++ libmozjs185-dev libcu-dev libcurl4-gnutls-dev libtool libicu-dev
cd apache-couchdb
./configure --prefix=/opt/couchdb --sysconfdir=/etc/opt/couchdb

make
make install

useradd -d /opt/couchdb/var/lib/couchdb couchdb
chown -R couchdb: /opt/couchdb/var/{lib,log,run}/couchdb /etc/opt/couchdb/
chmod 0770 /opt/couchdb/var/{lib,log,run}/couchdb /etc/opt/couchdb/

ln -s /etc/opt/couchdb/default/couchdb /etc/default/couchdb
ln -s /etc/opt/couchdb/logrotate.d/couchdb /etc/logrotate.d/couchdb
ln -s /etc/opt/couchdb/init.d/couchdb /etc/init.d/couchdb

update-rc.d couchdb defaults
service couchdb start

After installation, it is better to reboot the server/computer, otherwise CouchDB starts by itself even if you stop it with service couchdb stop. After a reboot everything is fine.

[↵] open page sborka-couchdb-iz-ishodnyh-kodov-v-ubuntu.md
-rw-r--r-- 1.6K Jan 10, 2013 · 87BA54F · ~2 min

PHP script for building all views in CouchDB

couchdb скрипты

I wrote this little script before New Year. It goes through all databases in CouchDB and builds all views one by one. Leaving it here.

<?php

            set_time_limit( 0 );

            // all dbs
            $ch = prepareCurlResource();
            curl_setopt( $ch, CURLOPT_URL, 'http://localhost:5984/_all_dbs' );
            $data = curl_exec( $ch );
            $dbs = json_decode( $data );

            foreach ( $dbs as $db ) {
                // skip _users and _replicator
                if ( substr( $db, 0, 1 ) == '_' )
                    continue;

                // getting all databases
                $chCC = prepareCurlResource();
                curl_setopt( $chCC, CURLOPT_URL, 'http://localhost:5984/' . $db . '/_all_docs?startkey="_design/"&endkey="_design0"&include_docs=true' );
                $data = json_decode( curl_exec( $chCC ) );

                if ( false === empty( $data->rows ) ) {
                    foreach( $data->rows as $design ) {

                        // creating views of design
                        if ( false === empty( $design->doc->views ) ) {
                            foreach( $design->doc->views as $viewName => $tmp ) {
                                echo 'Creating view: ' . $db . '/' . $design->id . '/_view/' . $viewName . "
";

                                $chCC = prepareCurlResource();
                                curl_setopt( $chCC, CURLOPT_URL, 'http://localhost:5984/' . $db . '/' . $design->id . '/_view/' . $viewName . '?limit=0' );
                                curl_exec( $chCC );
                            }
                        }
                    }
                }
            }

            function prepareCurlResource() {
            $ch = curl_init();
            curl_setopt( $ch, CURLOPT_PORT, 5984 );
            curl_setopt( $ch, CURLOPT_HEADER, false );
            curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
            curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-type: application/json' ) );

            return $ch;
            }
            
[↵] open page php-skript-dlya-sborki-vseh-vidov-v-couchdb.md
-rw-r--r-- 864B Jul 28, 2011 · A8C1296 · ~1 min

PUT problems after upgrading CouchDB to 1.1.0

couchdb траблы

Today we upgraded CouchDB on the production server to 1.1.0. Ran into a problem — PUT requests didn’t work, returning a strange error:

[error] => unknown_error
[reason] => function_clause

I.e. we couldn’t update a single document in the database, while POST requests for creating new documents worked just fine.

It turned out that when upgrading CouchDB from an older version to 1.1.0 there are two versions of some module left in the system (it might affect several modules) — the old one and the new one. These two versions conflict with each other.

The fix was simple, although a bit weird. You need to find where the *.beam files are stored on the system (in our case it’s /opt/couchdb), delete them (if you’re nervous, you can move them aside), then go back to the CouchDB source folder and run again:

make install
[↵] open page problemy-s-put-pri-obnovlenii-couchdb-do-110.md
makoni@arm1:~/blog$ cd .. // ↵ back to all posts