package storage // ToDo.. "errors" should this not be using my custom log wrapper import ( "context" "database/sql" ) type UsersRepo struct{ db *sql.DB } func NewUsersRepo(db *sql.DB) *UsersRepo { return &UsersRepo{db: db} } // ToDo: should the function be in sql? func (r *UsersRepo) Create(ctx context.Context, username, passwordHash string, isAdmin bool) error { _, err := r.db.ExecContext(ctx, `INSERT INTO users (username, password_hash, is_admin) VALUES (?, ?, ?)`, username, passwordHash, isAdmin, ) return err }