Complete GORM to sqlc migration
- Remove GORM dependency, use sqlc for type-safe SQL queries - Update all handlers to use sqlc patterns (context, value types) - Fix N+1 query problem in domain listing with JOIN query - Enable SQL query logging in debug mode (USE_EMBEDDED=false) - Add comprehensive comments for non-Go developers
This commit is contained in:
parent
dad96978e0
commit
c4e3a31b69
9 changed files with 94 additions and 97 deletions
|
|
@ -43,3 +43,11 @@ func (d *DB) GetAllDomainsWithCounts(ctx context.Context) ([]DomainStats, error)
|
|||
}
|
||||
return stats, nil
|
||||
}
|
||||
|
||||
func (d *DB) CountUsersByDomain(ctx context.Context, domainID uint32) (int64, error) {
|
||||
return d.Queries.CountUsersByDomain(ctx, domainID)
|
||||
}
|
||||
|
||||
func (d *DB) CountAliasesByDomain(ctx context.Context, domainID uint32) (int64, error) {
|
||||
return d.Queries.CountAliasesByDomain(ctx, domainID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue