Make use of new indexeddb StorageBucket API #2014
nickchomey
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
It should already be possible: const bucket = await navigator.storageBuckets.open('my-bucket');
const db = new Dexie('my-db', { indexedDB: bucket.indexedDB }); However, it could probably also be worth it to support it more user-friendly in Dexie. For example: const db = new Dexie('my-db', {
bucket: 'my-bucket',
persisted: true // passed to storageBuckets.open()
}); Question would be how to behave on browsers without the storagebuckets api? Probably to ignore the bucket and persisted arguments, or maybe default persisted to try StorageManager.persist(). But then what happens when the same user upgrades their browser and it gets this API? Probably user will suddenly get an empty DB now that the bucket is created. Comments? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The Storage Bucket API (Background blog) in Chromium browsers allows for better control of persistence and eviction. It is now also more performant, with a sort of multi-threaded implementation.
It would be beneficial if Dexie could implement its use in browsers that support it
Beta Was this translation helpful? Give feedback.
All reactions