Hallucinate hella cursor rules

This commit is contained in:
2025-10-10 20:07:44 +02:00
parent c199b3337a
commit 101138716f
5 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
---
globs: *.go
description: Database abstraction layer conventions
---
# Database Abstraction Standards
## High-Level Interface
The [db.go](mdc:db.go) file provides a high-level database interface. Always use these methods instead of raw GORM calls:
- `GetTokenForCharacter(characterName string) (*Token, error)`
- `SaveTokenForCharacter(token *Token) error`
- `AutoMigrate(dst ...interface{}) error`
## Never Use Raw GORM
- Don't call `s.db.DB().Where(...)` directly
- Don't call `s.db.DB().Save(...)` directly
- Always use the abstracted methods in the DB interface
## Database Operations
- All database operations should be logged with appropriate context
- Include character names in log messages for database operations
- Handle errors gracefully and log them with context