2022-03-02 03:23:12 +01:00
|
|
|
import Dexie from 'dexie';
|
|
|
|
|
|
|
|
// Uses Dexie.js
|
|
|
|
// https://dexie.org/docs/API-Reference#quick-reference
|
|
|
|
//
|
|
|
|
// Notes:
|
|
|
|
// - As per docs, we only declare the indexable columns, not all columns
|
|
|
|
|
|
|
|
const db = new Dexie('ntfy');
|
|
|
|
|
2022-05-08 00:10:48 +02:00
|
|
|
db.version(2).stores({
|
2022-03-02 22:16:30 +01:00
|
|
|
subscriptions: '&id,baseUrl',
|
2022-05-08 00:10:48 +02:00
|
|
|
notifications: '&id,subscriptionId,time,new,[subscriptionId+new],[id+new]', // compound keys for query performance
|
2022-03-02 04:01:51 +01:00
|
|
|
users: '&baseUrl,username',
|
|
|
|
prefs: '&key'
|
2022-03-02 03:23:12 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default db;
|