ntfy/web/src/app/db.js

19 lines
459 B
JavaScript
Raw Normal View History

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-07 23:16:08 +00:00
db.version(1).stores({
2022-03-02 21:16:30 +00:00
subscriptions: '&id,baseUrl',
2022-05-07 23:16:08 +00:00
notifications: '&id,subscriptionId,time,new,[subscriptionId+new]', // compound key for query performance
2022-03-02 03:01:51 +00:00
users: '&baseUrl,username',
prefs: '&key'
});
export default db;