summaryrefslogtreecommitdiff
path: root/model/rexps.sql.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--model/rexps.sql.go24
1 files changed, 8 insertions, 16 deletions
diff --git a/model/rexps.sql.go b/model/rexps.sql.go
index 9b32c5b..9c3f1c0 100644
--- a/model/rexps.sql.go
+++ b/model/rexps.sql.go
@@ -7,39 +7,28 @@ package model
import (
"context"
-
- "github.com/jackc/pgx/v5/pgtype"
)
const getRecurExpenses = `-- name: GetRecurExpenses :many
-SELECT id, description, expense, duration, start, "end"
+SELECT id, description, expense, duration, start, "end", prev_id, category_id, user_id
FROM recur_expenses
WHERE user_id = $1
`
-type GetRecurExpensesRow struct {
- ID int32
- Description pgtype.Text
- Expense pgtype.Numeric
- Duration pgtype.Interval
- Start pgtype.Date
- End pgtype.Date
-}
-
// GetRecurExpenses
//
-// SELECT id, description, expense, duration, start, "end"
+// SELECT id, description, expense, duration, start, "end", prev_id, category_id, user_id
// FROM recur_expenses
// WHERE user_id = $1
-func (q *Queries) GetRecurExpenses(ctx context.Context, userID int32) ([]GetRecurExpensesRow, error) {
+func (q *Queries) GetRecurExpenses(ctx context.Context, userID int32) ([]RecurExpense, error) {
rows, err := q.db.Query(ctx, getRecurExpenses, userID)
if err != nil {
return nil, err
}
defer rows.Close()
- var items []GetRecurExpensesRow
+ var items []RecurExpense
for rows.Next() {
- var i GetRecurExpensesRow
+ var i RecurExpense
if err := rows.Scan(
&i.ID,
&i.Description,
@@ -47,6 +36,9 @@ func (q *Queries) GetRecurExpenses(ctx context.Context, userID int32) ([]GetRecu
&i.Duration,
&i.Start,
&i.End,
+ &i.PrevID,
+ &i.CategoryID,
+ &i.UserID,
); err != nil {
return nil, err
}