mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 14:45:23 +01:00
6a360fb2e2
This commit attempts to fix some issues with the invoice store's schema that we couldn't foresee before the implementation was finished. This is safe as the schema has not been instantiated yet outside of unit tests. Furthermore the commit updates invoice store SQL queries according to fixes in the schema as well as to prepare the higher level implementation in the upcoming commits.
123 lines
2.8 KiB
Go
123 lines
2.8 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.25.0
|
|
// source: invoice_events.sql
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
const onAMPSubInvoiceCanceled = `-- name: OnAMPSubInvoiceCanceled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 4, $2, $3
|
|
)
|
|
`
|
|
|
|
type OnAMPSubInvoiceCanceledParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
SetID []byte
|
|
}
|
|
|
|
func (q *Queries) OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error {
|
|
_, err := q.db.ExecContext(ctx, onAMPSubInvoiceCanceled, arg.AddedAt, arg.InvoiceID, arg.SetID)
|
|
return err
|
|
}
|
|
|
|
const onAMPSubInvoiceCreated = `-- name: OnAMPSubInvoiceCreated :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 3, $2, $3
|
|
)
|
|
`
|
|
|
|
type OnAMPSubInvoiceCreatedParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
SetID []byte
|
|
}
|
|
|
|
func (q *Queries) OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error {
|
|
_, err := q.db.ExecContext(ctx, onAMPSubInvoiceCreated, arg.AddedAt, arg.InvoiceID, arg.SetID)
|
|
return err
|
|
}
|
|
|
|
const onAMPSubInvoiceSettled = `-- name: OnAMPSubInvoiceSettled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id, set_id
|
|
) VALUES (
|
|
$1, 5, $2, $3
|
|
)
|
|
`
|
|
|
|
type OnAMPSubInvoiceSettledParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
SetID []byte
|
|
}
|
|
|
|
func (q *Queries) OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error {
|
|
_, err := q.db.ExecContext(ctx, onAMPSubInvoiceSettled, arg.AddedAt, arg.InvoiceID, arg.SetID)
|
|
return err
|
|
}
|
|
|
|
const onInvoiceCanceled = `-- name: OnInvoiceCanceled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 1, $2
|
|
)
|
|
`
|
|
|
|
type OnInvoiceCanceledParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
}
|
|
|
|
func (q *Queries) OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error {
|
|
_, err := q.db.ExecContext(ctx, onInvoiceCanceled, arg.AddedAt, arg.InvoiceID)
|
|
return err
|
|
}
|
|
|
|
const onInvoiceCreated = `-- name: OnInvoiceCreated :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 0, $2
|
|
)
|
|
`
|
|
|
|
type OnInvoiceCreatedParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
}
|
|
|
|
func (q *Queries) OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error {
|
|
_, err := q.db.ExecContext(ctx, onInvoiceCreated, arg.AddedAt, arg.InvoiceID)
|
|
return err
|
|
}
|
|
|
|
const onInvoiceSettled = `-- name: OnInvoiceSettled :exec
|
|
INSERT INTO invoice_events (
|
|
added_at, event_type, invoice_id
|
|
) VALUES (
|
|
$1, 2, $2
|
|
)
|
|
`
|
|
|
|
type OnInvoiceSettledParams struct {
|
|
AddedAt time.Time
|
|
InvoiceID int64
|
|
}
|
|
|
|
func (q *Queries) OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error {
|
|
_, err := q.db.ExecContext(ctx, onInvoiceSettled, arg.AddedAt, arg.InvoiceID)
|
|
return err
|
|
}
|