| import WebSqlPouchCore from 'pouchdb-adapter-websql-core'; |
| import {guardedConsole} from 'pouchdb-utils'; |
| |
| import valid from './valid'; |
| |
| function openDB(name, version, description, size) { |
| // Traditional WebSQL API |
| return openDatabase(name, version, description, size); |
| } |
| |
| function WebSQLPouch(opts, callback) { |
| var msg = 'WebSQL is deprecated and will be removed in future releases of PouchDB. ' + |
| 'Please migrate to IndexedDB: https://pouchdb.com/2018/01/23/pouchdb-6.4.2.html'; |
| guardedConsole('warn', msg); |
| var _opts = Object.assign({ |
| websql: openDB |
| }, opts); |
| |
| WebSqlPouchCore.call(this, _opts, callback); |
| } |
| |
| WebSQLPouch.valid = valid; |
| |
| WebSQLPouch.use_prefix = true; |
| |
| export default function (PouchDB) { |
| PouchDB.adapter('websql', WebSQLPouch, true); |
| } |