Closed make-github-pseudonymous-again closed 2 years ago
I just tried to make idb
work on top of indexeddbshim
and I encountered issues similar to https://github.com/indexeddbshim/IndexedDBShim/issues/70 and https://github.com/indexeddbshim/IndexedDBShim/issues/361. Still trying to see if I can make something work.
await openDB(name, version, {indexedDB, ...})
seems reasonable, but I guess there isn't a rush to do this while IndexedDBShim
is buggy around its microtask timing.
After further inspection it seems npm:indexeddbshim
is incompatible with idb
: the transaction automatic closing logic seems to be broken, I've tried both the browser implementation and the node implementation. Since npm:indexeddb
is dated and since https://deno.land/x/indexeddb
is based on npm:indexeddbshim
I do not see any reason right now to implement support.
Agreed. Hopefully a compatible implementation will appear in future. Happy to look at this again later.
Is your feature request related to a problem? Please describe. I'd like to be able to use this wrapper with alternative implementations of IndexedDB. I know of three such implementations:
npm:indexeddb
,npm:indexeddbshim
https://deno.land/x/indexeddb
Describe the solution you'd like I know there is
wrap
that can be used once you get your hands on an instance produced by the IndexedDB API, but currently you cannot wrap the following two lines :https://github.com/jakearchibald/idb/blob/82cad7cf582205f773da252a2cec188922c1f801/src/entry.ts#L52
https://github.com/jakearchibald/idb/blob/82cad7cf582205f773da252a2cec188922c1f801/src/entry.ts#L98
Would be nice to have either
const {openDB} = wrap(indexedDB);
or similar, orawait openDB(name, version, {indexedDB, ...});
.Globally defining
indexedDB
with one of those implementations is also a solution but it is not a solution I like.