ditto/src/db.ts

15 lines
236 B
TypeScript
Raw Normal View History

2023-07-09 16:47:19 +00:00
import { Dongoose, z } from '@/deps.ts';
const db = await Deno.openKv();
const Users = Dongoose({
pubkey: z.string(),
username: z.string(),
}, {
db,
name: 'users',
indexes: ['pubkey', 'username'],
});
export { db, Users };