Add new guidelines to claude.md

This commit is contained in:
dal 2025-07-22 11:09:42 -06:00
parent 43763ccfbb
commit a33bbc9559
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 7 additions and 0 deletions

View File

@ -249,6 +249,13 @@ export async function getWorkspaceSettingsHandler(
## Database Operations ## Database Operations
### Query Organization
- **All database queries must be created as helper functions** in `@packages/database/src/queries/`
- **Organize by table** - Each table should have its own subdirectory (e.g., `assets/`, `chats/`, `users/`)
- **Type all queries** - Every query function must have properly typed parameters and return types
- **Export from index** - Each subdirectory should have an `index.ts` that exports all queries for that table
- **Reusable and composable** - Write queries as small, focused functions that can be composed together
### Soft Delete and Upsert Practices ### Soft Delete and Upsert Practices
- In our database, we never hard delete, we always use soft deletes with the `deleted_at` field - In our database, we never hard delete, we always use soft deletes with the `deleted_at` field
- For update operations, we should almost always perform an upsert unless otherwise specified - For update operations, we should almost always perform an upsert unless otherwise specified