import { createPentagon, TableDefinition, } from 'https://deno.land/x/pentagon@v0.1.5/mod.ts' import { TodoModel, UserModel } from '@homeman/models.ts' export const kv = await Deno.openKv('homeman.db') export const schema: Record = { users: { schema: UserModel, relations: { assignedTodos: ['todos', [TodoModel], 'id', 'assigneeUserId'], }, }, todos: { schema: TodoModel, relations: { assignee: ['users', UserModel, 'assigneeUserId', 'id'], }, }, } export const db = createPentagon(kv, schema)