42 lines
881 B
Go
42 lines
881 B
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.27.0
|
|
// source: transaction.sql
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
const insertTransaction = `-- name: InsertTransaction :exec
|
|
INSERT INTO "transaction" (
|
|
created_at, updated_at, amount, currency, expense_id, user_id, is_income
|
|
) VALUES ( $1, $2, $3, $4, $5, $6, $7 )
|
|
RETURNING id, expense_id, user_id, amount, currency, is_income, created_at, updated_at
|
|
`
|
|
|
|
type InsertTransactionParams struct {
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
Amount int32
|
|
Currency string
|
|
ExpenseID int32
|
|
UserID int32
|
|
IsIncome bool
|
|
}
|
|
|
|
func (q *Queries) InsertTransaction(ctx context.Context, arg InsertTransactionParams) error {
|
|
_, err := q.db.ExecContext(ctx, insertTransaction,
|
|
arg.CreatedAt,
|
|
arg.UpdatedAt,
|
|
arg.Amount,
|
|
arg.Currency,
|
|
arg.ExpenseID,
|
|
arg.UserID,
|
|
arg.IsIncome,
|
|
)
|
|
return err
|
|
}
|