snort/src/db.ts

17 lines
354 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({
2023-01-15 12:26:21 +00:00
users: '++pubkey, name, display_name, picture, nip05' // Primary key and indexed props
2023-01-15 01:46:13 +00:00
});
}
}
2023-01-15 11:06:44 +00:00
export const db = new SnortDB();