Page MenuHomePhabricator

[web-db] add indexedDB config

Authored by kamil on Mar 7 2023, 8:45 AM.
Referenced Files
Unknown Object (File)
Sun, Apr 7, 4:12 PM
Unknown Object (File)
Wed, Apr 3, 8:28 AM
Unknown Object (File)
Wed, Apr 3, 8:28 AM
Unknown Object (File)
Wed, Apr 3, 8:27 AM
Unknown Object (File)
Wed, Apr 3, 8:19 AM
Unknown Object (File)
Feb 21 2024, 4:06 AM
Unknown Object (File)
Feb 21 2024, 1:56 AM
Unknown Object (File)
Feb 20 2024, 11:36 PM



Adding config according to docs.

Depends on D6986, D6989, D6988

Test Plan

Run this code:

try {
  const value = await localforage.setItem('test', {
    prop: 'test prop',
} catch (err) {

and check in devtools (web and desktop) if database was properly created

Diff Detail

rCOMM Comm
Lint Not Applicable
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Mar 7 2023, 10:06 AM
12 ↗(On Diff #23508)

Is this version used e.g. for migrations?

12 ↗(On Diff #23508)

It can be, but we won't use it for this purpose.

For database (SQLite) versioning, we will use the same pattern as on native (PRAGMA user_version;).

IndexedDB will be a key-value store with two keys and I don't think it'll ever need to migrate - if so I would introduce the keyserver's approach with an additional metadata key.

Updating this version here will result in calling native callback upgradeneeded, but it's not that good, and locaforage as well as other similar libs does not supper this.
Adding this here only for config types compatibility.

This revision is now accepted and ready to land.Mar 15 2023, 3:22 AM
This revision was automatically updated to reflect the committed changes.