Introduce own Numeric type and revert to stdlib from pgx

This commit is contained in:
2021-12-02 21:29:44 +00:00
parent 6f8a94ff5d
commit 4646356b2d
16 changed files with 136 additions and 57 deletions

View File

@ -22,7 +22,7 @@ type CreatePayeeParams struct {
}
func (q *Queries) CreatePayee(ctx context.Context, arg CreatePayeeParams) (Payee, error) {
row := q.db.QueryRow(ctx, createPayee, arg.Name, arg.BudgetID)
row := q.db.QueryRowContext(ctx, createPayee, arg.Name, arg.BudgetID)
var i Payee
err := row.Scan(&i.ID, &i.BudgetID, &i.Name)
return i, err
@ -34,7 +34,7 @@ WHERE payees.budget_id = $1
`
func (q *Queries) GetPayees(ctx context.Context, budgetID uuid.UUID) ([]Payee, error) {
rows, err := q.db.Query(ctx, getPayees, budgetID)
rows, err := q.db.QueryContext(ctx, getPayees, budgetID)
if err != nil {
return nil, err
}
@ -47,6 +47,9 @@ func (q *Queries) GetPayees(ctx context.Context, budgetID uuid.UUID) ([]Payee, e
}
items = append(items, i)
}
if err := rows.Close(); err != nil {
return nil, err
}
if err := rows.Err(); err != nil {
return nil, err
}