-
Notifications
You must be signed in to change notification settings - Fork 14
Idb #1601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Idb #1601
Conversation
@@ -1,2 +1,3 @@ | |||
export { default } from './CozyPouchLink' | |||
export { default as SQLiteQuery } from './db/sqlite/sqliteDb' | |||
export { default as IndexedDBQueryEngine } from './db/idb/idb' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The naming is not homogenous with SQLiteQuery
(you added the Engine
suffix)
const request = version | ||
? indexedDB.open(fullDbName, version) | ||
: indexedDB.open(fullDbName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version is used there, but we never provide it? Do we expect to use it in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is never provided, but it might be (and I tried few things during tests), so I prefer to keep it for now
} | ||
|
||
async openDB(dbName, version = undefined, { forceName = false } = {}) { | ||
return new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openDB()
is not declared as async in dbInterfaces file, but more important, it is not awaited in PouchManager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
return resp | ||
} catch (err) { | ||
logger.error(err) | 10000||
return null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I fixed the interface, it was already returning null in sqlite
limit, | ||
partialFilter, | ||
skip = 0, | ||
shouldRecreateIndex = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't find any code that set shouldRecreateIndex
. Is that a change that will be implemented later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is helpful to quickly set this for debug purposes
PouchDB sometimes badly handle the `$gt: null` selector, thus we transform it into `$gt: ''` See pouchdb/pouchdb#7192
This is the equivalent of #1598 , but for IndexedDB, so this time for browser.
I will complete with performances measure later