sqlc

package
v1.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmpSubInvoice

type AmpSubInvoice struct {
	SetID       []byte
	State       int16
	CreatedAt   time.Time
	SettledAt   sql.NullTime
	SettleIndex sql.NullInt64
	InvoiceID   int64
}

type AmpSubInvoiceHtlc

type AmpSubInvoiceHtlc struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteInvoiceParams

type DeleteInvoiceParams struct {
	AddIndex    sql.NullInt64
	Hash        []byte
	SettleIndex sql.NullInt64
	PaymentAddr []byte
}

type FetchAMPSubInvoiceHTLCsParams

type FetchAMPSubInvoiceHTLCsParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchAMPSubInvoiceHTLCsRow

type FetchAMPSubInvoiceHTLCsRow struct {
	SetID        []byte
	RootShare    []byte
	ChildIndex   int64
	Hash         []byte
	Preimage     []byte
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type FetchAMPSubInvoicesParams

type FetchAMPSubInvoicesParams struct {
	InvoiceID int64
	SetID     []byte
}

type FetchSettledAMPSubInvoicesParams

type FetchSettledAMPSubInvoicesParams struct {
	SettleIndexGet sql.NullInt64
	SettleIndexLet sql.NullInt64
}

type FetchSettledAMPSubInvoicesRow

type FetchSettledAMPSubInvoicesRow struct {
	SetID              []byte
	AmpSettleIndex     sql.NullInt64
	AmpSettledAt       sql.NullTime
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type FilterInvoicesParams

type FilterInvoicesParams struct {
	AddIndexGet    sql.NullInt64
	AddIndexLet    sql.NullInt64
	SettleIndexGet sql.NullInt64
	SettleIndexLet sql.NullInt64
	State          sql.NullInt16
	CreatedAfter   sql.NullTime
	CreatedBefore  sql.NullTime
	PendingOnly    interface{}
	Reverse        interface{}
	NumOffset      int32
	NumLimit       int32
}

type GetInvoiceHTLCCustomRecordsRow

type GetInvoiceHTLCCustomRecordsRow struct {
	HtlcID int64
	Key    int64
	Value  []byte
}

type GetInvoiceParams

type GetInvoiceParams struct {
	SetID       []byte
	AddIndex    sql.NullInt64
	Hash        []byte
	PaymentAddr []byte
}

type InsertAMPSubInvoiceHTLCParams

type InsertAMPSubInvoiceHTLCParams struct {
	InvoiceID  int64
	SetID      []byte
	HtlcID     int64
	RootShare  []byte
	ChildIndex int64
	Hash       []byte
	Preimage   []byte
}

type InsertAMPSubInvoiceParams added in v1.0.7

type InsertAMPSubInvoiceParams struct {
	SetID       []byte
	State       int16
	CreatedAt   time.Time
	SettledAt   sql.NullTime
	SettleIndex sql.NullInt64
	InvoiceID   int64
}

type InsertInvoiceFeatureParams

type InsertInvoiceFeatureParams struct {
	InvoiceID int64
	Feature   int32
}

type InsertInvoiceHTLCCustomRecordParams

type InsertInvoiceHTLCCustomRecordParams struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InsertInvoiceHTLCParams

type InsertInvoiceHTLCParams struct {
	HtlcID       int64
	ChanID       string
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InsertInvoiceParams

type InsertInvoiceParams struct {
	Hash               []byte
	Preimage           []byte
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InsertKVInvoiceKeyAndAddIndexParams added in v1.0.7

type InsertKVInvoiceKeyAndAddIndexParams struct {
	ID       int64
	AddIndex int64
}

type InsertMigratedInvoiceParams added in v1.0.7

type InsertMigratedInvoiceParams struct {
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type Invoice

type Invoice struct {
	ID                 int64
	Hash               []byte
	Preimage           []byte
	SettleIndex        sql.NullInt64
	SettledAt          sql.NullTime
	Memo               sql.NullString
	AmountMsat         int64
	CltvDelta          sql.NullInt32
	Expiry             int32
	PaymentAddr        []byte
	PaymentRequest     sql.NullString
	PaymentRequestHash []byte
	State              int16
	AmountPaidMsat     int64
	IsAmp              bool
	IsHodl             bool
	IsKeysend          bool
	CreatedAt          time.Time
}

type InvoiceEvent

type InvoiceEvent struct {
	ID        int64
	AddedAt   time.Time
	EventType int32
	InvoiceID int64
	SetID     []byte
}

type InvoiceEventType

type InvoiceEventType struct {
	ID          int64
	Description string
}

type InvoiceFeature

type InvoiceFeature struct {
	Feature   int32
	InvoiceID int64
}

type InvoiceHtlc

type InvoiceHtlc struct {
	ID           int64
	ChanID       string
	HtlcID       int64
	AmountMsat   int64
	TotalMppMsat sql.NullInt64
	AcceptHeight int32
	AcceptTime   time.Time
	ExpiryHeight int32
	State        int16
	ResolveTime  sql.NullTime
	InvoiceID    int64
}

type InvoiceHtlcCustomRecord

type InvoiceHtlcCustomRecord struct {
	Key    int64
	Value  []byte
	HtlcID int64
}

type InvoicePaymentHash added in v1.0.7

type InvoicePaymentHash struct {
	ID       int64
	AddIndex int64
	Hash     []byte
}

type InvoiceSequence

type InvoiceSequence struct {
	Name         string
	CurrentValue int64
}

type MigrationTracker added in v1.0.7

type MigrationTracker struct {
	Version       int32
	MigrationTime time.Time
}

type OnAMPSubInvoiceCanceledParams

type OnAMPSubInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceCreatedParams

type OnAMPSubInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnAMPSubInvoiceSettledParams

type OnAMPSubInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
	SetID     []byte
}

type OnInvoiceCanceledParams

type OnInvoiceCanceledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceCreatedParams

type OnInvoiceCreatedParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type OnInvoiceSettledParams

type OnInvoiceSettledParams struct {
	AddedAt   time.Time
	InvoiceID int64
}

type Querier

type Querier interface {
	ClearKVInvoiceHashIndex(ctx context.Context) error
	DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)
	DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)
	FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)
	FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)
	FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)
	FilterInvoices(ctx context.Context, arg FilterInvoicesParams) ([]Invoice, error)
	GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)
	GetDatabaseVersion(ctx context.Context) (int32, error)
	// This method may return more than one invoice if filter using multiple fields
	// from different invoices. It is the caller's responsibility to ensure that
	// we bubble up an error in those cases.
	GetInvoice(ctx context.Context, arg GetInvoiceParams) ([]Invoice, error)
	GetInvoiceByHash(ctx context.Context, hash []byte) (Invoice, error)
	GetInvoiceBySetID(ctx context.Context, setID []byte) ([]Invoice, error)
	GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)
	GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)
	GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)
	GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) ([]byte, error)
	GetMigration(ctx context.Context, version int32) (time.Time, error)
	InsertAMPSubInvoice(ctx context.Context, arg InsertAMPSubInvoiceParams) error
	InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error
	InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)
	InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error
	InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)
	InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error
	InsertKVInvoiceKeyAndAddIndex(ctx context.Context, arg InsertKVInvoiceKeyAndAddIndexParams) error
	InsertMigratedInvoice(ctx context.Context, arg InsertMigratedInvoiceParams) (int64, error)
	NextInvoiceSettleIndex(ctx context.Context) (int64, error)
	OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error
	OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error
	OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error
	OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error
	OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error
	OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error
	SetKVInvoicePaymentHash(ctx context.Context, arg SetKVInvoicePaymentHashParams) error
	SetMigration(ctx context.Context, arg SetMigrationParams) error
	UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)
	UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error
	UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)
	UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error
	UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error
	UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)
	UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) ClearKVInvoiceHashIndex added in v1.0.7

func (q *Queries) ClearKVInvoiceHashIndex(ctx context.Context) error

func (*Queries) DeleteCanceledInvoices

func (q *Queries) DeleteCanceledInvoices(ctx context.Context) (sql.Result, error)

func (*Queries) DeleteInvoice

func (q *Queries) DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) (sql.Result, error)

func (*Queries) FetchAMPSubInvoiceHTLCs

func (q *Queries) FetchAMPSubInvoiceHTLCs(ctx context.Context, arg FetchAMPSubInvoiceHTLCsParams) ([]FetchAMPSubInvoiceHTLCsRow, error)

func (*Queries) FetchAMPSubInvoices

func (q *Queries) FetchAMPSubInvoices(ctx context.Context, arg FetchAMPSubInvoicesParams) ([]AmpSubInvoice, error)

func (*Queries) FetchSettledAMPSubInvoices

func (q *Queries) FetchSettledAMPSubInvoices(ctx context.Context, arg FetchSettledAMPSubInvoicesParams) ([]FetchSettledAMPSubInvoicesRow, error)

func (*Queries) FilterInvoices

func (q *Queries) FilterInvoices(ctx context.Context, arg FilterInvoicesParams) ([]Invoice, error)

func (*Queries) GetAMPInvoiceID

func (q *Queries) GetAMPInvoiceID(ctx context.Context, setID []byte) (int64, error)

func (*Queries) GetDatabaseVersion added in v1.0.7

func (q *Queries) GetDatabaseVersion(ctx context.Context) (int32, error)

func (*Queries) GetInvoice

func (q *Queries) GetInvoice(ctx context.Context, arg GetInvoiceParams) ([]Invoice, error)

This method may return more than one invoice if filter using multiple fields from different invoices. It is the caller's responsibility to ensure that we bubble up an error in those cases.

func (*Queries) GetInvoiceByHash added in v1.0.7

func (q *Queries) GetInvoiceByHash(ctx context.Context, hash []byte) (Invoice, error)

func (*Queries) GetInvoiceBySetID added in v1.0.4

func (q *Queries) GetInvoiceBySetID(ctx context.Context, setID []byte) ([]Invoice, error)

func (*Queries) GetInvoiceFeatures

func (q *Queries) GetInvoiceFeatures(ctx context.Context, invoiceID int64) ([]InvoiceFeature, error)

func (*Queries) GetInvoiceHTLCCustomRecords

func (q *Queries) GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int64) ([]GetInvoiceHTLCCustomRecordsRow, error)

func (*Queries) GetInvoiceHTLCs

func (q *Queries) GetInvoiceHTLCs(ctx context.Context, invoiceID int64) ([]InvoiceHtlc, error)

func (*Queries) GetKVInvoicePaymentHashByAddIndex added in v1.0.7

func (q *Queries) GetKVInvoicePaymentHashByAddIndex(ctx context.Context, addIndex int64) ([]byte, error)

func (*Queries) GetMigration added in v1.0.7

func (q *Queries) GetMigration(ctx context.Context, version int32) (time.Time, error)

func (*Queries) InsertAMPSubInvoice added in v1.0.7

func (q *Queries) InsertAMPSubInvoice(ctx context.Context, arg InsertAMPSubInvoiceParams) error

func (*Queries) InsertAMPSubInvoiceHTLC

func (q *Queries) InsertAMPSubInvoiceHTLC(ctx context.Context, arg InsertAMPSubInvoiceHTLCParams) error

func (*Queries) InsertInvoice

func (q *Queries) InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int64, error)

func (*Queries) InsertInvoiceFeature

func (q *Queries) InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error

func (*Queries) InsertInvoiceHTLC

func (q *Queries) InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) (int64, error)

func (*Queries) InsertInvoiceHTLCCustomRecord

func (q *Queries) InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error

func (*Queries) InsertKVInvoiceKeyAndAddIndex added in v1.0.7

func (q *Queries) InsertKVInvoiceKeyAndAddIndex(ctx context.Context, arg InsertKVInvoiceKeyAndAddIndexParams) error

func (*Queries) InsertMigratedInvoice added in v1.0.7

func (q *Queries) InsertMigratedInvoice(ctx context.Context, arg InsertMigratedInvoiceParams) (int64, error)

func (*Queries) NextInvoiceSettleIndex

func (q *Queries) NextInvoiceSettleIndex(ctx context.Context) (int64, error)

func (*Queries) OnAMPSubInvoiceCanceled

func (q *Queries) OnAMPSubInvoiceCanceled(ctx context.Context, arg OnAMPSubInvoiceCanceledParams) error

func (*Queries) OnAMPSubInvoiceCreated

func (q *Queries) OnAMPSubInvoiceCreated(ctx context.Context, arg OnAMPSubInvoiceCreatedParams) error

func (*Queries) OnAMPSubInvoiceSettled

func (q *Queries) OnAMPSubInvoiceSettled(ctx context.Context, arg OnAMPSubInvoiceSettledParams) error

func (*Queries) OnInvoiceCanceled

func (q *Queries) OnInvoiceCanceled(ctx context.Context, arg OnInvoiceCanceledParams) error

func (*Queries) OnInvoiceCreated

func (q *Queries) OnInvoiceCreated(ctx context.Context, arg OnInvoiceCreatedParams) error

func (*Queries) OnInvoiceSettled

func (q *Queries) OnInvoiceSettled(ctx context.Context, arg OnInvoiceSettledParams) error

func (*Queries) SetKVInvoicePaymentHash added in v1.0.7

func (q *Queries) SetKVInvoicePaymentHash(ctx context.Context, arg SetKVInvoicePaymentHashParams) error

func (*Queries) SetMigration added in v1.0.7

func (q *Queries) SetMigration(ctx context.Context, arg SetMigrationParams) error

func (*Queries) UpdateAMPSubInvoiceHTLCPreimage

func (q *Queries) UpdateAMPSubInvoiceHTLCPreimage(ctx context.Context, arg UpdateAMPSubInvoiceHTLCPreimageParams) (sql.Result, error)

func (*Queries) UpdateAMPSubInvoiceState

func (q *Queries) UpdateAMPSubInvoiceState(ctx context.Context, arg UpdateAMPSubInvoiceStateParams) error

func (*Queries) UpdateInvoiceAmountPaid

func (q *Queries) UpdateInvoiceAmountPaid(ctx context.Context, arg UpdateInvoiceAmountPaidParams) (sql.Result, error)

func (*Queries) UpdateInvoiceHTLC

func (q *Queries) UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error

func (*Queries) UpdateInvoiceHTLCs

func (q *Queries) UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error

func (*Queries) UpdateInvoiceState

func (q *Queries) UpdateInvoiceState(ctx context.Context, arg UpdateInvoiceStateParams) (sql.Result, error)

func (*Queries) UpsertAMPSubInvoice

func (q *Queries) UpsertAMPSubInvoice(ctx context.Context, arg UpsertAMPSubInvoiceParams) (sql.Result, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type SetKVInvoicePaymentHashParams added in v1.0.7

type SetKVInvoicePaymentHashParams struct {
	ID   int64
	Hash []byte
}

type SetMigrationParams added in v1.0.7

type SetMigrationParams struct {
	Version       int32
	MigrationTime time.Time
}

type UpdateAMPSubInvoiceHTLCPreimageParams

type UpdateAMPSubInvoiceHTLCPreimageParams struct {
	InvoiceID int64
	SetID     []byte
	ChanID    string
	HtlcID    int64
	Preimage  []byte
}

type UpdateAMPSubInvoiceStateParams

type UpdateAMPSubInvoiceStateParams struct {
	SetID       []byte
	State       int16
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpdateInvoiceAmountPaidParams

type UpdateInvoiceAmountPaidParams struct {
	ID             int64
	AmountPaidMsat int64
}

type UpdateInvoiceHTLCParams

type UpdateInvoiceHTLCParams struct {
	HtlcID      int64
	ChanID      string
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceHTLCsParams

type UpdateInvoiceHTLCsParams struct {
	InvoiceID   int64
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceStateParams

type UpdateInvoiceStateParams struct {
	ID          int64
	State       int16
	Preimage    []byte
	SettleIndex sql.NullInt64
	SettledAt   sql.NullTime
}

type UpsertAMPSubInvoiceParams

type UpsertAMPSubInvoiceParams struct {
	SetID     []byte
	State     int16
	CreatedAt time.Time
	InvoiceID int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL