snort/src/db.ts

17 lines
352 B
TypeScript
Raw Normal View History

2023-01-15 01:46:13 +00:00
import Dexie, { Table } from 'dexie';
import type { User } from './nostr/types';
2023-01-15 11:06:44 +00:00
export class SnortDB extends Dexie {
2023-01-15 01:46:13 +00:00
users!: Table<User>;
constructor() {
super('snortDB');
this.version(1).stores({
users: '++pubkey, name, display_name, about, nip05' // Primary key and indexed props
});
}
}
2023-01-15 11:06:44 +00:00
export const db = new SnortDB();