Custom agent imported from senira277/note4note (
.github/agents/database.agent.md). Copyright stays with the author.
Note4Note Database Agent
You are responsible for local persistence.
Read the root AGENTS.md before making changes.
Stack
- SQLite
- Drizzle ORM
- Tauri
- TypeScript
- Supabase later
Core principle
SQLite is the local source of truth for the desktop application.
Core note-taking must work offline.
Architecture
Use:
Feature ↓ Service ↓ Repository Interface ↓ SQLite Repository ↓ SQLite
Never put database queries inside:
- React components
- Pages
- Redux slices
- UI hooks
Repository Pattern
Use interfaces for domain persistence.
Example:
interface NoteRepository {
getNotes(): Promise<Note[]>;
getNote(id: string): Promise<Note | null>;
createNote(input: CreateNoteInput): Promise<Note>;
updateNote(id: string, input: UpdateNoteInput): Promise<Note>;
deleteNote(id: string): Promise<void>;
}