snort/src/db.ts

17 lines
372 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';
export class MySubClassedDexie extends Dexie {
users!: Table<User>;
constructor() {
super('snortDB');
this.version(1).stores({
users: '++pubkey, name, display_name, about, nip05' // Primary key and indexed props
});
}
}
export const db = new MySubClassedDexie();