| 5 | import Dexie, { EntityTable } from "dexie"; |
| 6 | |
| 7 | class FreeNoteDB extends Dexie { |
| 8 | notes!: EntityTable<Note, "id">; |
| 9 | embeddings!: EntityTable<Embedding, "id">; |
| 10 | chats!: EntityTable<Chat, "id">; |
| 11 | chatMessages!: EntityTable<ChatMessage, "id">; |
| 12 | |
| 13 | constructor() { |
| 14 | super("freenote"); |
| 15 | this.version(1).stores({ |
| 16 | notes: "++id, title, type, createdAt, updatedAt, embeddingUpdatedAt", |
| 17 | embeddings: "++id, noteId, content, embedding", |
| 18 | chats: "++id, title, updatedAt, createdAt", |
| 19 | chatMessages: "++id, chatId", |
| 20 | }); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | export const db = new FreeNoteDB(); |
| 25 | export * from "@/lib/db/schema/chat"; |
nothing calls this directly
no outgoing calls
no test coverage detected