:koala: - PouchDB is a pocket-sized database.
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.
this
of changesHandler
#8583 #8581 We introduced a bug in the #8450 refactor that has been fixed now.
#8570 We were testing our CI in GHA against Node 12, which is EOL. Now we are testing against Node 14.
equal(7)
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!
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:
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.
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"
}]
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
}
created_at/updated_at
naming_purgeRev
methodpurged_infos_limit
supportpartial_filter_selector
in ddocsAs 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!
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:
_id
was mappped to data._id
instead of idAs 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!
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:
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:
async/await
) into your new tests contributions.indexeddb
adapter in the default distributionThe 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.
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.
partial_filter_selector
#8276 #8277 Now PouchDB-find supports partial_filter_selector
.
#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
.
#8324 During replication, we can subscribe to checkpoint
events, which will emit the following properties: checkpoint
, revs_diff
, start_next_batch
and pending_batch
.
style
to replication options#8380 #8379 We expose changes feed style
to replication options.
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'});
In Github we have enabled:
_access
field in documentspartial_filter_selector
auto_compaction
to indexeddb bulkDocspartial_filter_selector
option to createIndex()packages/node_modules/pouchdb/dist
views.*.map
should pass on more recent CouchDB versions which do not reject the design doc on write, but fail on queries insteadpackages/node_modules
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!
#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.
For a full changelog from 7.1.1 to 7.2.1, please see the releases page or view the latest commits.
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.
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.
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.
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!
#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.
#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.
#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.
#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.
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!
In this release PouchDB now supports IndexedDB by default in Safari and will drop support for WebSQL in future versions.
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.
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);
});
}
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.
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!