Regenerate sqlc
This commit is contained in:
parent
adce350e0c
commit
cdc767a497
@ -17,7 +17,7 @@ RETURNING id, name, last_modification
|
||||
`
|
||||
|
||||
func (q *Queries) CreateBudget(ctx context.Context, name string) (Budget, error) {
|
||||
row := q.db.QueryRowContext(ctx, createBudget, name)
|
||||
row := q.db.QueryRow(ctx, createBudget, name)
|
||||
var i Budget
|
||||
err := row.Scan(&i.ID, &i.Name, &i.LastModification)
|
||||
return i, err
|
||||
@ -29,7 +29,7 @@ WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetBudget(ctx context.Context, id uuid.UUID) (Budget, error) {
|
||||
row := q.db.QueryRowContext(ctx, getBudget, id)
|
||||
row := q.db.QueryRow(ctx, getBudget, id)
|
||||
var i Budget
|
||||
err := row.Scan(&i.ID, &i.Name, &i.LastModification)
|
||||
return i, err
|
||||
@ -42,7 +42,7 @@ WHERE user_budgets.user_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetBudgetsForUser(ctx context.Context, userID uuid.UUID) ([]Budget, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getBudgetsForUser, userID)
|
||||
rows, err := q.db.Query(ctx, getBudgetsForUser, userID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -55,9 +55,6 @@ func (q *Queries) GetBudgetsForUser(ctx context.Context, userID uuid.UUID) ([]Bu
|
||||
}
|
||||
items = append(items, i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ package postgres
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgtype"
|
||||
)
|
||||
|
||||
const createTransaction = `-- name: CreateTransaction :one
|
||||
@ -20,14 +20,14 @@ RETURNING id, date, memo, amount, account_id, payee_id
|
||||
|
||||
type CreateTransactionParams struct {
|
||||
Date time.Time
|
||||
Memo sql.NullString
|
||||
Amount string
|
||||
Memo string
|
||||
Amount pgtype.Numeric
|
||||
AccountID uuid.UUID
|
||||
PayeeID uuid.NullUUID
|
||||
}
|
||||
|
||||
func (q *Queries) CreateTransaction(ctx context.Context, arg CreateTransactionParams) (Transaction, error) {
|
||||
row := q.db.QueryRowContext(ctx, createTransaction,
|
||||
row := q.db.QueryRow(ctx, createTransaction,
|
||||
arg.Date,
|
||||
arg.Memo,
|
||||
arg.Amount,
|
||||
@ -52,7 +52,7 @@ WHERE transactions.account_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.UUID) ([]Transaction, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getTransactionsForAccount, accountID)
|
||||
rows, err := q.db.Query(ctx, getTransactionsForAccount, accountID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -72,9 +72,6 @@ func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.
|
||||
}
|
||||
items = append(items, i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -88,7 +85,7 @@ WHERE accounts.budget_id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetTransactionsForBudget(ctx context.Context, budgetID uuid.UUID) ([]Transaction, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getTransactionsForBudget, budgetID)
|
||||
rows, err := q.db.Query(ctx, getTransactionsForBudget, budgetID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -108,9 +105,6 @@ func (q *Queries) GetTransactionsForBudget(ctx context.Context, budgetID uuid.UU
|
||||
}
|
||||
items = append(items, i)
|
||||
}
|
||||
if err := rows.Close(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ type LinkBudgetToUserParams struct {
|
||||
}
|
||||
|
||||
func (q *Queries) LinkBudgetToUser(ctx context.Context, arg LinkBudgetToUserParams) (UserBudget, error) {
|
||||
row := q.db.QueryRowContext(ctx, linkBudgetToUser, arg.UserID, arg.BudgetID)
|
||||
row := q.db.QueryRow(ctx, linkBudgetToUser, arg.UserID, arg.BudgetID)
|
||||
var i UserBudget
|
||||
err := row.Scan(&i.UserID, &i.BudgetID)
|
||||
return i, err
|
||||
|
@ -24,7 +24,7 @@ type CreateUserParams struct {
|
||||
}
|
||||
|
||||
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, createUser,
|
||||
row := q.db.QueryRow(ctx, createUser,
|
||||
arg.ID,
|
||||
arg.Email,
|
||||
arg.Name,
|
||||
@ -46,7 +46,7 @@ WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetUser(ctx context.Context, id uuid.UUID) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, getUser, id)
|
||||
row := q.db.QueryRow(ctx, getUser, id)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
@ -63,7 +63,7 @@ WHERE email = $1
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserByUsername(ctx context.Context, email string) (User, error) {
|
||||
row := q.db.QueryRowContext(ctx, getUserByUsername, email)
|
||||
row := q.db.QueryRow(ctx, getUserByUsername, email)
|
||||
var i User
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
|
Loading…
x
Reference in New Issue
Block a user