database.go 495 B

12345678910111213
  1. package dbmanager
  2. // DbManager defines the interface for database operations
  3. type DbManager interface {
  4. Connect() error
  5. Disconnect() error
  6. Create(entityType string, entity interface{}) error
  7. GetByID(entityType string, id string) (interface{}, error)
  8. Update(entityType string, entity interface{}) error
  9. Delete(entityType string, id string) error
  10. List(entityType string, filter map[string]interface{}) ([]interface{}, error)
  11. Exec(query string, args ...interface{}) (interface{}, error)
  12. }