pouchdb-community / pouchdb-adapter-cordova-sqlite

PouchDB adapter for Cordova SQLite. Designed for PouchDB 6+.
Apache License 2.0
73 stars 32 forks source link

Probably a dumb question, sorry!! #74

Closed SyneosLee closed 6 years ago

SyneosLee commented 7 years ago

Hi,

When declaring a new PouchDB instance with the cordova-sqlite adapter installed...

How does the coding differ than if you weren't using the adapter... I don't understand what the adapter is for, is it to override the default?

Again, sorry for the basic question.

Cheers

pablomaurer commented 7 years ago

Here you are saying that you will use the cordova-sqlite adapter, but this adapter is not included by default in PouchDB, because it was to complicated to automatically decide when to use this adapter. So they decided to take it out of the core and make it available as a plugin.

var db = new PouchDB('mydb.db', {adapter: 'cordova-sqlite'});

If you don't use this adapter, PouchDB will decide by itself wich adapter to use.

This plugin adds a new adapter, that is not included in the core. And you can define to use it via the adapter option. If you will never define it via the adapter option this plugin never get's used.

SyneosLee commented 7 years ago

Cool, thanks.

Can you point me to any websites/videos whatever, that explains fully about using adapters?

pablomaurer commented 7 years ago

https://pouchdb.com/adapters.html