Pouchdb Versions Save

:koala: - PouchDB is a pocket-sized database.

8.0.1

1 year ago

The first release of the year! This is a patch release, it fixes a bug we introduced during a refactor made in the last release and sets Node 14 in our CI. For a full changelog from 8.0.0 to 8.0.1, please see the releases page or view the latest commits.

Fix this of changesHandler

#8583 #8581 We introduced a bug in the #8450 refactor that has been fixed now.

Use Node 14

#8570 We were testing our CI in GHA against Node 12, which is EOL. Now we are testing against Node 14.

Changelog

Bugfixes

Documentation

  • 4dcaac82 docs: release post for 8.0.0
  • 0bdb3423 feat: add mastodon verification link
  • 40ac7a26 feat(site): faster website uploads, rsync skips files that are already on the server
  • ae69d4fb fix(blog): title case
  • 3728f020 Update 2022-12-14-pouchdb-8.0.0.md
  • c90a0208 Update 2022-12-14-pouchdb-8.0.0.md
  • e9bf059c docs: update to version 8.0.0
  • 7484e245 docs: update 2022-12-14-pouchdb-8.0.0.md

Testing

Get in touch

As always, we welcome feedback from the community. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

8.0.0

1 year ago

We are thrilled to announce the release of PouchDB's new major version 8.0.0. For a full changelog from 7.3.1 to 8.0.0, please see the releases page or view the latest commits. Here are the highlights:

Embracing modern ES6+ JS syntax

We have started the process of moving to ES6+ syntax. We made refactors to use native JS classes instead of prototypes, deprecated some packages that implemented features that are now built in the language (inherits, argsarray), and started in packages such as pouchdb-abstract-mapreduce and pouchdb-adapter-http. We encourage you to embrace the syntax in your new contributions and, if you can, contribute to the refactoring effort.

This might mean a potentially breaking change, therefore we bump the major version. If you need to support ES5 we recommend you use a transpiler.

Add activeTasks

#8422 #8441 Analogous to the _active_tasks feature in CouchDB, PouchDB now has activeTasks. With this functionality, PouchDB is able to list all active database tasks, like database_compaction, view_indexing, or replication. PouchDB will report the progress of these tasks to the active tasks API and remove tasks as soon as they are completed or have failed.

Example usage:

let tasks = PouchDB.activeTasks.list()

Example result:

[{
  "id": "d81fea92-8ce4-42df-bb2b-89a4e67536c3",
  "name": "database_compaction",
  "created_at": "2022-02-08T15:38:45.318Z",
  "total_items": 12,
  "completed_items": 1,
  "updated_at": "2022-02-08T15:38:45.821Z"
}]

Add purge to the indexeddb adapter

#8453 Similar to CouchDB's purge, PouchDB has now purge for its indexeddb adapter.

Purge permanently removes data from the database. Normal deletion with db.remove() does not, it only marks the document as _deleted=true and creates a new revision. This behaviour ensures that deletes can be replicated across databases, and deleted documents don’t get undeleted by syncing with a database that still has this document.

db.purge() is not intended as a regular method for deleting documents, instead, it is meant as an admin function for cases where some secret was erroneously added to the database and must now be removed completely, eg. a credit card or social security number. Purge effectively puts the database in a state where the offending write never happened.

Example usage:

try {
  const result = await db.purge('mydoc', '6-3a24009a9525bde9e4bfa8a99046b00d');
  // handle result
} catch (error) {
  // handle error
}

Example result:

{
  "ok": true,
  "deletedRevs": [
    "6-3a24009a9525bde9e4bfa8a99046b00d",
    "5-df4a81cd21c75c71974d96e88a68fc2f"
  ],
  "documentWasRemovedCompletely": false
}

Changelog

New features

  • 0680c0ac feat(core): simple active tasks implementation
  • c3fc43cc feat: use activeTasks error handling
  • 9a83c11f feat(core): activeTasks remove reason argument
  • 40dc6b37 feat(replicate): track live replications in activeTasks
  • f5b6d35e feat(core): view indexing use activeTasks API
  • d784b49a feat(replicate): replication uses activeTasks API
  • 52a52495 feat: database compaction use activeTasks API
  • ed0db363 feat(core): make activeTasks.list() return array
  • eaf9d52f feat(core): active tasks created_at/updated_at naming
  • 544eb77d feat(purge): add purge to core
  • ec1b7872 chore(purge): remove only from purge tests
  • 3445a012 feat(indexeddb): proof-of-concept purge method
  • e861d00f wip(indexeddb): stub _purgeRev method
  • 972ae331 wip(merge): findPathToLeaf, removeLeafFromTree
  • 4e921ebd feat(merge): removeLeafFromTree return empty trees
  • 3e3f7613 feat: make purge delete docs if tree is empty
  • a8b5e00c feat(indexeddb): attachment purging
  • 693ea5c1 feat(purge): handle missing doc, return something
  • 774976a0 feat: on-update view purging
  • 94ec8932 feat(core): purged_infos_limit support
  • ce8f8b30 [wip] Purge leaves from multiple roots
  • 4252a0f0 docs(purge): show result object seperately
  • b856173b chore(purge): add code comments
  • d5f4250a chore(purge): remove unneeded logs and comments
  • 2c0ddbb0 feat(purge): simplify implementation of removeLeafFromTree()

Bugfixes

  • 34a79749 fix: check replication currentBatch
  • 8f33ff0a fix: add activeTask stub to mock replication database
  • 3fe71b03 (#8491) - Fix $regex and $ne within $or operator
  • 86ccf481 fix(core): active tasks object datastructure
  • 5f61b1fe fix partial filter find on indexeddb adapter
  • 759ea5a0 fix: store partial_filter_selector in ddocs
  • 9519c748 fix: active tasks race condition
  • 25a12e11 fix(merge): removeLeafFromTree to properly use branchings
  • d5f29f7b fix(indexeddb): rev purging typo
  • f0958b50 fix(purge): use callback in adapter
  • b20139e1 fix(core): purge error values
  • 4d11ef51 fix(a-m-r): purge check return value
  • 203ae670 fix: remove logging
  • 24157fcf (#8513) - Race condition for pouchdb hanging indefinitely when multiple instances are used
  • 15092e8e chore: catch selenium errors earlier
  • 2eca392b fix: (#8471) filterInclusiveStart for nested fields
  • 45dc5ae8 Fix the implementation of _bulkDocs() in the http adapter without using adapterFun()
  • fcb71db4 fix: active task total items calculation (#8508)
  • 76d35e44 fix: replication cancellation race condition (#8507)

Documentation

  • 7c6753a6 Mark a few words in the 7.3 post as code so that markdown does not italicise them
  • 486076d2 Fix formatting of 7.3 release post by adding blank lines
  • c6719367 Add new author in the docs
  • 9cc72318 Add 7.3.0 release post
  • 140896cb feat: update site version to 7.3.0
  • d9c19182 docs: update PouchDB on page
  • 2afc29f7 docs: release script note
  • 861003ad docs: clarify release process
  • 47cb987c Add 7.3.1 release post
  • f00d1193 feat: update site version to 7.3.1
  • 0140bfa5 docs: active tasks API
  • 2de982e5 add performance warning for indexeddb
  • 5faa060c docs(purge): add first draft of purge docs
  • 3cfb4af4 docs(purge): update docs
  • d1c04dd5 Update attachments.md : outdated external link
  • 0200eea4 Update 2022-04-13-pouchdb-7.3.0.md

Testing

  • a3bf8ff0 test(#8522): add failing test for partial index
  • 69ce67ad chore(core): lint activetasks code and tests
  • 5fd15227 test(purge): unit tests for findPathToLeaf util
  • 621cf0a1 wip: multi-root tree purge tests
  • f28b4ad5 [wip] failing test showing bug in tracking node position in removeLeafFromTree()
  • 868937d8 tests(purge): fix tests for fixed multi-root removals
  • 63026167 chore(purge): lint
  • 8e83728b perf-tests: make wording clearer for multiple adapters
  • 34a8cf52 (#8568) - use eslint cache
  • 2b9b7fac fix(tests): reformat tree fixtures
  • 581c1048 feat(tests): purge integration tests
  • df77ecbf refactor a test that timeout to use async
  • 404346bb chore: upgrade webpack for testing

Dependency updates

  • 50d2c33a Remove inherits package dependency
  • 4974b64a refactor: remove argsarray dependency

Refactor

  • 7350a701 refactor: use es6 classes
  • 08e46002 refactor: deprecate inherits in pouchdb-core
  • 99ebea32 refactor: use class in sublevel-pouchdb
  • d4ff99b4 refactor: use classes instead of prototypes
  • 21d7975c feat(core): refactor ActiveTasks with ES6 classes
  • 07d055ae refactor: use rest parameters in find utils
  • d02eaaf0 refactor: remove argsarray usage
  • 701f96dc refactor: use await in abstract-mapreduce
  • 74a6d6fd refactor: remove unnecessary async
  • 73e0199c refactor: use ES6 syntax in http adapter
  • 133978fe refactor: use ES6 syntax in abstract-mapreduce
  • 27128d6d chore: remove obsolete replication revision-one optimization (#8499)

Other changes

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

7.3.1

1 year ago

We're happy to announce the release of PouchDB 7.3.1, bringing in some fixes and dependency updates. For a full changelog from 7.3.0 to 7.3.1, please see the releases page or view the latest commits. Some of the highlights:

Changelog

Bugfixes

  • 7db104c5 (#8463) - check if docFieldValue is also null value. typeof null returns object in javasctipy. Fixes a bug when querying against and array with a null value, $elemMatch and $allMatch.
  • 719502dc (#8225) - Added check for blob.type setter
  • d5bb7bd6 (#8389) - _id was mappped to data._id instead of id
  • bbeb7e55 (#8531) - fix sorted find including deleted docs

Testing

Dependency updates

  • 922f7b54 (#8470) - fix: upgrade promise-polyfill from 8.2.0 to 8.2.3

Other changes

  • fa57c294 (#8468) Replace deprecated String.prototype.substr()
  • 5a52f2ce (#8343) - Add contextual data to the error message of failing tryMap and tryReduce

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

7.3.0

2 years ago

We're happy to announce the release of PouchDB 7.3.0, bringing in features, fixes and dependency updates. For a full changelog from 7.2.2 to 7.3.0, please see the releases page or view the latest commits. Some of the highlights:

Improving testing

We have been investing lots of time into our test suites, with around 36 commits, 112 files changed, 3314 insertions and 2064 deletions made about this topic. We have:

  • Migrated from Travis CI to Github Actions, which has improved the speed, throughput and reliability of our CI.
  • Rewrote TESTING.md documentation.
  • Upgraded eslint configuration in order to use ES6 syntax within our tests. Feel free to incorporate newer syntax (such as async/await) into your new tests contributions.
  • Fixed bugs in CI configuration: ADAPTERS and GREP variables weren't working correctly, background servers being started incorrectly, build failure caused by an older version of pouchdb-express-router.
  • Unified the configuration variables used in the build.
  • Fix the majority of non-deterministic tests to substantially reduce random failure during CI runs, and put in tooling for retrying failed tasks. This includes improving tests that check behaviour for unreachable servers, which previously relied on a third party service being available.
  • Restructured the CI tasks so that each task exercises a single backend (i.e. CouchDB server version or client-side PouchDB adapter), rather than some combination of local and remote adapters. This reduces the impact of flaky tests, reduces the duration of each task, reduces redundant tasks repeating the same work, and allows more parallelisation of tests.
  • Improved the test coverage across target platforms, including cross-browser tests, different Node.js versions, and different CouchDB versions. We have fixed tests that assume CouchDB v1.x behaviour so that they now work on v2.x and v3.x.
  • Allowed the indexeddb adapter to be loaded and used during tests

Add indexeddb adapter in the default distribution

The indexeddb adapter is now available in the default distribution. You can use it specifying the adapter:

PouchDB.plugin(require('pouchdb-adapter-indexeddb'));
const db = new PouchDB('mydb', {adapter: 'indexeddb'});

Please note that it is considered BETA quality, use it carefully and please report any issues you find. Thank you.

Add view_update_changes_batch_size

#8320 With view_update_changes_batch_size, we can now specify how many change records will be consumed at a time when rebuilding view indexes when the query() method is used.

Support partial_filter_selector

#8276 #8277 Now PouchDB-find supports partial_filter_selector.

Indexing event to show the progress of view updates

#8321 We can now subscribe to an indexing event, which will emit a progress object containing the properties view, last_seq, results_count and indexed_docs.

Checkpoint events during replication

#8324 During replication, we can subscribe to checkpoint events, which will emit the following properties: checkpoint, revs_diff, start_next_batch and pending_batch.

Add style to replication options

#8380 #8379 We expose changes feed style to replication options.

Add view_adapter option

#8335 view_adapter provides an option for the user to specify a separate adapter to store their view index in addition to the main adapter for their core data:

const db = new PouchDB(DB_NAME, {adapter: 'idb', view_adapter: 'memory'});

Enable discussions and projects

In Github we have enabled:

  • Discussions: feel free to open and participate
  • Projects: we are keeping track of the issues and PRs for future releases.

Changelog

New features

  • 7cc1c8e3 (#8171) - Allow _access field in documents
  • b359d788 Let caller set the change batch size when updating views (#8320)
  • a9e2996b (#8277) - Support partial_filter_selector
  • 0875b19a Add an indexing event to show progress of view updates
  • fe9bd028 Add checkpoint events during replication
  • b523a1d2 (#8379) - Expose changes feed style to replication options (#8380)
  • (#8335) Add view adapter option

Bugfixes

  • b8d3fc65 (#8229) - indexeddb: ensure errors are propagated and handle database deletion
  • fe7ffa9c (#8237) - Conform pouchdb find operators to couchdb's (#8327)
  • 0e27e23f (#8222) - fix multiple $regex conditions on same field when using $and
  • ab451d9e (#8165) - Initial dollar sign escaped with unit tests.
  • f544c822 (#8242) - unhandled promise rejection in upsert
  • 62dd11bf (#8185) - Fix date checking
  • a6a34357 (#8187) - Don't include leveldown in browsers
  • 9bf13109 (#7331) - Close leveldb file handlers
  • be55391b (#8274) - rev() should clone only when needed
  • 8377ae00 (#8316) - Properly handle transaction abort
  • c4aaf255 Fix escaping of key path segments in indexeddb adapter (#8358)
  • 77d9782a Fix memory leak when replications fails
  • 73a9bad4 fix: add auto_compaction to indexeddb bulkDocs
  • (#8460) Fix writing erroneous attachment rev references in bulkDocs
  • (#8370) Implement skip and limit for keys query #8404
  • (#8473) Add stack to CustomPouchError (fix #8372)
  • (#8473) Add idb global database failure error as reason to transaction errors #8414

Documentation

Testing

  • 04d2a458 (#8227) - Remove saucelabs test runs
  • 095ada4f (#8319) - Fix node build ordering
  • 451e7ec4 (#8325) - Reduce the number of travis runs
  • 1e6cfa1a Update indexing event test to use async/await instead of callbacks
  • 9f5da871 Update checkpoint event test to use async/await instead of callbacks
  • 2218ed1c Parse query string into an object in webrunner.js
  • b39b98f7 Load adapters as plugins only if they are present in packages/node_modules/pouchdb/dist
  • 731a83ba Remove the ADAPTER variable from the browser test scripts and update CI config and docs
  • 7a8ff25f Replace remaining uses of ADAPTER in tests with ADAPTERS
  • efa56c8c Turn indexeddb into a plugin and make it loadable via the ADAPTERS option
  • 6c5d601a Run "find" tests against a single implementation at a time (#8359)
  • 4a9562d2 Quote arguments to mocha(1) to make GREP work correctly (#8363)
  • d9edb532 Fix mapreduce tests (#8365)
  • 453dd3e6 Consistent loading of PouchDB in tests (#8366)
  • 18c74c3e Migrate CI to GitHub Actions (#8368)
  • 55b5ee5b Add test for broken skip in pouch-find (#8371)
  • 566502c7 fix(test): skip test setup and assertions were wrong
  • 07376ded chore(test): uncomment test for future fix
  • 45413a6e chore: rename build node variable
  • c0771a7d fix: skip building node on webpack tests
  • 1fc976f7 Add webpack test to github actions
  • 469a4938 Fix mapreduce tests that assume bulkDocs() response order, which pouchdb-server does not guarantee
  • fc7f6855 Test for non-string values for views.*.map should pass on more recent CouchDB versions which do not reject the design doc on write, but fail on queries instead
  • 5b0903cb Add missing "npm test" command in mapreduce CI tasks
  • ea46e5a8 Run integration tests on Node.js, and with the memory adapter, and use ADAPTERS (plural) to set the adapter
  • 423124c0 Run integration tests against CouchDB and pouchdb-server
  • 4040b214 Add all the combinations for testing the pouchdb-find plugin to the CI matrix
  • 6893afd5 Build pouchdb-server correctly during tests on GitHub Actions
  • d3912687 Refactor the GitHub actions workflows
  • ac7bcc65 Do not run eslint after all tests, but make it a distinct task that other CI jobs depend on
  • 6786456d test: add couchdb 2.3 browser matrix
  • 1ba99d64 test: remove debugging logs
  • ad520298 feat: add down server, use it in tests
  • fc690dd4 test: refactor in replication test replicate from down server test
  • e7e3eff7 feat: add retries to failed jobs in gha ci
  • 31bc31f8 fix: node build on tests

Dependency updates

Other changes

  • 1ba87970 (#8167) - Revert Jekyll to 3.9.0 to be able to build doumentation (+ doc updates)
  • dfdb55e6 (#8219) - Update stale bot configuration
  • 1a48c541 Upgrade eslint ecmaVersion to 8
  • 1d8d7500 Update issue template's adapters
  • d5f47348 chore: fix eslint running at packages/node_modules
  • d143e02e chore: remove local, unneeded eslint config
  • b1742b1d chore: fix eslint no-prototype-builtins errors
  • 41d70ea8 Update README's build status badge
  • dae3e384 Add or update repository field in package.jsons

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues, open discussions or get in touch. And of course, a big thanks to all of our new and existing contributors!

7.2.2

3 years ago

7.2.1

4 years ago

New indexeddb adapter

#7618 - We are excited to announce the release of a new adapter for indexeddb access which uses native indexes rather than custom tables. This is an additional adapter rather than an upgrade so you can continue using "idb" for the old version or choose to switch to "indexeddb". The new version is not backwards compatible and data migration is left as an exercise for the reader.

Other changes

For a full changelog from 7.1.1 to 7.2.1, please see the releases page or view the latest commits.

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

NB: There was an issue while publishing which broke the 7.2.0 release - use this release instead.

7.1.1

4 years ago

we have another PouchDB release. The main improvements in this release are bug fixes and dependency updates. For a full changelog from 7.0 to 7.1.0, please see the releases page or view the latest commits.

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

If you wondering where is 7.1.0, I had a slight publishing issue so the easiest was to bump it up to 7.1.1 to do a fresh deploy.

7.0.0

5 years ago

As promised back in January it is time to drop WebSQL from our default builds. This not only lets us focus our development efforts on a single engine but along with the other changes explained below reduces the default PouchDB package size from 148KB to 122KB, thats 17.5% smaller!

Removed WebSQL

#6943 - The WebSQL adapter is still available to download and use, it will no longer be available as part of a default PouchDB build and will eventually be moved to the pouchdb-community repo. If you need to migrate your users from WebSQL to IndexeDB then there is some advice available in our previous release post.

Removed Promise Polyfill

#6945 - Including our own Promise polyfill means larger bundles when most apps already include their own polyfill if they need it. So if you support browsers which do not support Promises natively you will need to include a polyfill yourself. We use promise-polyfill and have found it to work great.

Switch to fetch

#6944 - This is another API that may need polyfilled if you use PouchDB and support IE, we use whatwg-fetch. Switching to fetch has allowed us to expose the ability to intercept the requests PouchDB makes for more flexibility, such as:

var db = new PouchDB('http://example.com/dbname', {
  fetch: function (url, opts) {
    opts.headers.set('X-Some-Special-Header', 'foo');
    return PouchDB.fetch(url, opts);
  }
});

That will add a X-Some-Special-Header to every HTTP request PouchDB makes.

Deterministic Revisions

#4642 - We now match CouchDB default behaviour and use the documents contents to determine its revision, this means automated conflict resolution handlers are less likely to generate extra conflicts.

More Deprecations

  • #6946 - Remove debug dep
  • #7134 - Remove IndexedDB storage option
  • #6944 - Remove deprecated skipSetup

Fixes

  • #7040 - Use fixed-length array in idb/indexeddb allDocs
  • #6655 - Use consistent types for replication progress values
  • #7085 - Accept old Safari version as valid
  • #7095 - Reduce replication to server requests
  • #7115 - Remove catastrophic backtracking vulnerability
  • #7127 - Fix docs for db.query()'s options.reduce default
  • #7141 - Fix ios idb blobSupport silent fail
  • #6502 - Set return_docs default false when opts.live = true
  • #7216 - Check level.destroy exists before calling
  • #5814 - Ensure prefix has trailing slash

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!

6.4.3

6 years ago

6.4.2

6 years ago

In this release PouchDB now supports IndexedDB by default in Safari and will drop support for WebSQL in future versions.

A brief history of WebSQL

Just over 5 years ago PouchDB got its first support for WebSQL, originally to support Opera WebSQL was able to pick up for the lack of support for IndexedDB in Safari and gave PouchDB the ability to support a wide variety of browsers. Opera gained IndexedDB support from its switch to Blink / Chromium and with WebSQL failing to become a web standard Safari started supporting IndexedDB from its 7.1 release. Initially there were too many bugs in Safari's implementation for PouchDB to use it however after a lot of work from the WebKit devs and a few releases IndexedDB support became stable in Safari and as of this release is now the default storage engine for PouchDB in Safari.

Switching to IndexedDB vastly reduces the amount of work we need to do to keep PouchDB stable, any new features and improvements relating to storage up until now has meant duplicating the entire code and effort for WebSQL, we will also see a nice reduction in the bundle size.

Migrating current users

If you are using PouchDB and expect to want to use new releases then you will need to migrate your current users, this release of PouchDB supports both WebSQL and IndexedDB in Safari so one solution that may work depending on your circumstances is to replicate between them like so:

function openDB(name, opts) {
  return new Promise(function(resolve, reject) {
    var localdb = new PouchDB(name, opts);
    localdb.info().then(function(info) {

      if (info.adapter !== 'websql') {
        return resolve(localdb);
      }

      var newopts = opts || {};
      newopts.adapter = 'idb';

      var newdb = new PouchDB(name, opts);
      var replicate = localdb.replicate.to(newdb);
      replicate.then(function() {
        resolve(newdb);
      }).catch(reject);
    }).catch(reject);
  });
}

More Deprecations

With PouchDB we aim to keep breaking changes to a minimum which means when we do have a breaking change release like the upcoming 7.0 there will usually be a few other changes. Currently it looks likely that we will remove our Promise Polyfill and switch to the fetch API for HTTP requests. These arent all certain and you can follow along or join in with the 7.0 release discussion here.

Other Changes

  • #7019 - Dont crash on empty HTTP requests
  • #7008 - Add Glitch bug helper
  • #6954 - Fix hang when storage quota is exceeded
  • #6958 - Fix PouchDB find with zero values
  • #6971 - Fix allDocs keys and limit < keys.length

Get in touch

As always, we welcome feedback from the community and would love to hear what you think of this release as well as PouchDB's future direction. Please don't hesitate to file issues or get in touch. And of course, a big thanks to all of our new and existing contributors!