Page MenuHomePhabricator

[web-db] add indexedDB config
ClosedPublic

Authored by kamil on Mar 7 2023, 8:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 4:27 PM
Unknown Object (File)
Sat, Dec 14, 4:27 PM
Unknown Object (File)
Sat, Dec 14, 4:27 PM
Unknown Object (File)
Sat, Dec 14, 4:18 PM
Unknown Object (File)
Tue, Nov 26, 2:37 PM
Unknown Object (File)
Nov 2 2024, 2:54 AM
Unknown Object (File)
Nov 2 2024, 12:28 AM
Unknown Object (File)
Nov 2 2024, 12:28 AM
Subscribers

Details

Summary

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',
  });
  console.log(value);
} catch (err) {
  console.log(err);
}

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

Diff Detail

Repository
rCOMM Comm
Branch
db-on-web-2
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Mar 7 2023, 10:06 AM
web/database/worker/web-db-worker.js
12

Is this version used e.g. for migrations?

web/database/worker/web-db-worker.js
12

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.