sqlc

package
v0.17.0-beta Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AmpInvoiceHtlc

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

type AmpInvoicePayment

type AmpInvoicePayment struct {
	SetID        []byte
	State        int16
	CreatedAt    time.Time
	SettledIndex sql.NullInt32
	InvoiceID    int32
}

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.NullInt32
	Hash        []byte
	Preimage    []byte
	PaymentAddr []byte
}

type FilterInvoicePaymentsParams

type FilterInvoicePaymentsParams struct {
	SettleIndexGet sql.NullInt32
	SettledAfter   sql.NullTime
	Reverse        interface{}
	NumOffset      int32
	NumLimit       int32
}

type FilterInvoicePaymentsRow

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

type FilterInvoicesParams

type FilterInvoicesParams struct {
	AddIndexGet   sql.NullInt32
	AddIndexLet   sql.NullInt32
	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 {
	AddIndex    sql.NullInt32
	Hash        []byte
	Preimage    []byte
	PaymentAddr []byte
}

type GetSetIDHTLCsCustomRecordsRow

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

type InsertAMPInvoiceHTLCParams

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

type InsertAMPInvoicePaymentParams

type InsertAMPInvoicePaymentParams struct {
	SetID        []byte
	State        int16
	CreatedAt    time.Time
	SettledIndex sql.NullInt32
	InvoiceID    int32
}

type InsertInvoiceEventParams

type InsertInvoiceEventParams struct {
	CreatedAt     time.Time
	InvoiceID     int32
	HtlcID        sql.NullInt64
	SetID         []byte
	EventType     int32
	EventMetadata []byte
}

type InsertInvoiceFeatureParams

type InsertInvoiceFeatureParams struct {
	InvoiceID int32
	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    int32
}

type InsertInvoiceParams

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

type InsertInvoicePaymentParams

type InsertInvoicePaymentParams struct {
	InvoiceID      int32
	AmountPaidMsat int64
	SettledAt      time.Time
}

type Invoice

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

type InvoiceEvent

type InvoiceEvent struct {
	ID            int32
	CreatedAt     time.Time
	InvoiceID     int32
	HtlcID        sql.NullInt64
	SetID         []byte
	EventType     int32
	EventMetadata []byte
}

type InvoiceEventType

type InvoiceEventType struct {
	ID          int32
	Description string
}

type InvoiceFeature

type InvoiceFeature struct {
	Feature   int32
	InvoiceID int32
}

type InvoiceHtlc

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

type InvoiceHtlcCustomRecord

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

type InvoicePayment

type InvoicePayment struct {
	ID             int32
	SettledAt      time.Time
	AmountPaidMsat int64
	InvoiceID      int32
}

type Querier

type Querier interface {
	DeleteAMPHTLCCustomRecords(ctx context.Context, invoiceID int32) error
	DeleteAMPHTLCs(ctx context.Context, invoiceID int32) error
	DeleteAMPInvoiceHTLC(ctx context.Context, setID []byte) error
	DeleteInvoice(ctx context.Context, arg DeleteInvoiceParams) error
	DeleteInvoiceEvents(ctx context.Context, invoiceID int32) error
	DeleteInvoiceFeatures(ctx context.Context, invoiceID int32) error
	DeleteInvoiceHTLC(ctx context.Context, htlcID int64) error
	DeleteInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int32) error
	DeleteInvoiceHTLCs(ctx context.Context, invoiceID int32) error
	FilterInvoicePayments(ctx context.Context, arg FilterInvoicePaymentsParams) ([]FilterInvoicePaymentsRow, error)
	FilterInvoices(ctx context.Context, arg FilterInvoicesParams) ([]Invoice, error)
	GetAMPInvoiceHTLCsByInvoiceID(ctx context.Context, invoiceID int32) ([]AmpInvoiceHtlc, error)
	GetAMPInvoiceHTLCsBySetID(ctx context.Context, setID []byte) ([]AmpInvoiceHtlc, 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)
	GetInvoiceFeatures(ctx context.Context, invoiceID int32) ([]InvoiceFeature, error)
	GetInvoiceHTLCCustomRecords(ctx context.Context, invoiceID int32) ([]GetInvoiceHTLCCustomRecordsRow, error)
	GetInvoiceHTLCs(ctx context.Context, invoiceID int32) ([]InvoiceHtlc, error)
	GetInvoicePayments(ctx context.Context, invoiceID int32) ([]InvoicePayment, error)
	GetSetIDHTLCsCustomRecords(ctx context.Context, setID []byte) ([]GetSetIDHTLCsCustomRecordsRow, error)
	InsertAMPInvoiceHTLC(ctx context.Context, arg InsertAMPInvoiceHTLCParams) error
	InsertAMPInvoicePayment(ctx context.Context, arg InsertAMPInvoicePaymentParams) error
	InsertInvoice(ctx context.Context, arg InsertInvoiceParams) (int32, error)
	InsertInvoiceEvent(ctx context.Context, arg InsertInvoiceEventParams) error
	InsertInvoiceFeature(ctx context.Context, arg InsertInvoiceFeatureParams) error
	InsertInvoiceHTLC(ctx context.Context, arg InsertInvoiceHTLCParams) error
	InsertInvoiceHTLCCustomRecord(ctx context.Context, arg InsertInvoiceHTLCCustomRecordParams) error
	InsertInvoicePayment(ctx context.Context, arg InsertInvoicePaymentParams) (int32, error)
	SelectAMPInvoicePayments(ctx context.Context, arg SelectAMPInvoicePaymentsParams) ([]SelectAMPInvoicePaymentsRow, error)
	SelectInvoiceEvents(ctx context.Context, arg SelectInvoiceEventsParams) ([]InvoiceEvent, error)
	UpdateAMPInvoiceHTLC(ctx context.Context, arg UpdateAMPInvoiceHTLCParams) error
	UpdateAMPPayment(ctx context.Context, arg UpdateAMPPaymentParams) error
	UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) error
	UpdateInvoiceHTLC(ctx context.Context, arg UpdateInvoiceHTLCParams) error
	UpdateInvoiceHTLCs(ctx context.Context, arg UpdateInvoiceHTLCsParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeleteAMPHTLCCustomRecords

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

func (*Queries) DeleteAMPHTLCs

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

func (*Queries) DeleteAMPInvoiceHTLC

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

func (*Queries) DeleteInvoice

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

func (*Queries) DeleteInvoiceEvents

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

func (*Queries) DeleteInvoiceFeatures

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

func (*Queries) DeleteInvoiceHTLC

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

func (*Queries) DeleteInvoiceHTLCCustomRecords

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

func (*Queries) DeleteInvoiceHTLCs

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

func (*Queries) FilterInvoicePayments

func (q *Queries) FilterInvoicePayments(ctx context.Context, arg FilterInvoicePaymentsParams) ([]FilterInvoicePaymentsRow, error)

func (*Queries) FilterInvoices

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

func (*Queries) GetAMPInvoiceHTLCsByInvoiceID

func (q *Queries) GetAMPInvoiceHTLCsByInvoiceID(ctx context.Context, invoiceID int32) ([]AmpInvoiceHtlc, error)

func (*Queries) GetAMPInvoiceHTLCsBySetID

func (q *Queries) GetAMPInvoiceHTLCsBySetID(ctx context.Context, setID []byte) ([]AmpInvoiceHtlc, 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) GetInvoiceFeatures

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

func (*Queries) GetInvoiceHTLCCustomRecords

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

func (*Queries) GetInvoiceHTLCs

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

func (*Queries) GetInvoicePayments

func (q *Queries) GetInvoicePayments(ctx context.Context, invoiceID int32) ([]InvoicePayment, error)

func (*Queries) GetSetIDHTLCsCustomRecords

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

func (*Queries) InsertAMPInvoiceHTLC

func (q *Queries) InsertAMPInvoiceHTLC(ctx context.Context, arg InsertAMPInvoiceHTLCParams) error

func (*Queries) InsertAMPInvoicePayment

func (q *Queries) InsertAMPInvoicePayment(ctx context.Context, arg InsertAMPInvoicePaymentParams) error

func (*Queries) InsertInvoice

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

func (*Queries) InsertInvoiceEvent

func (q *Queries) InsertInvoiceEvent(ctx context.Context, arg InsertInvoiceEventParams) 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) error

func (*Queries) InsertInvoiceHTLCCustomRecord

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

func (*Queries) InsertInvoicePayment

func (q *Queries) InsertInvoicePayment(ctx context.Context, arg InsertInvoicePaymentParams) (int32, error)

func (*Queries) SelectAMPInvoicePayments

func (q *Queries) SelectAMPInvoicePayments(ctx context.Context, arg SelectAMPInvoicePaymentsParams) ([]SelectAMPInvoicePaymentsRow, error)

func (*Queries) SelectInvoiceEvents

func (q *Queries) SelectInvoiceEvents(ctx context.Context, arg SelectInvoiceEventsParams) ([]InvoiceEvent, error)

func (*Queries) UpdateAMPInvoiceHTLC

func (q *Queries) UpdateAMPInvoiceHTLC(ctx context.Context, arg UpdateAMPInvoiceHTLCParams) error

func (*Queries) UpdateAMPPayment

func (q *Queries) UpdateAMPPayment(ctx context.Context, arg UpdateAMPPaymentParams) error

func (*Queries) UpdateInvoice

func (q *Queries) UpdateInvoice(ctx context.Context, arg UpdateInvoiceParams) 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) WithTx

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

type SelectAMPInvoicePaymentsParams

type SelectAMPInvoicePaymentsParams struct {
	SetID        []byte
	SettledIndex sql.NullInt32
	InvoiceID    sql.NullInt32
}

type SelectAMPInvoicePaymentsRow

type SelectAMPInvoicePaymentsRow struct {
	SetID          []byte
	State          int16
	CreatedAt      time.Time
	SettledIndex   sql.NullInt32
	InvoiceID      int32
	ID             sql.NullInt32
	SettledAt      sql.NullTime
	AmountPaidMsat sql.NullInt64
	InvoiceID_2    sql.NullInt32
}

type SelectInvoiceEventsParams

type SelectInvoiceEventsParams struct {
	InvoiceID     sql.NullInt32
	HtlcID        sql.NullInt64
	SetID         []byte
	EventType     sql.NullInt32
	CreatedAfter  sql.NullTime
	CreatedBefore sql.NullTime
	NumOffset     int32
	NumLimit      int32
}

type UpdateAMPInvoiceHTLCParams

type UpdateAMPInvoiceHTLCParams struct {
	Preimage []byte
	HtlcID   int64
}

type UpdateAMPPaymentParams

type UpdateAMPPaymentParams struct {
	State        int16
	SettledIndex sql.NullInt32
	SetID        []byte
	InvoiceID    sql.NullInt32
}

type UpdateInvoiceHTLCParams

type UpdateInvoiceHTLCParams struct {
	ID          int32
	State       int16
	ResolveTime sql.NullTime
}

type UpdateInvoiceHTLCsParams

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

type UpdateInvoiceParams

type UpdateInvoiceParams struct {
	ID             int32
	Preimage       []byte
	State          int16
	AmountPaidMsat int64
}

Jump to

Keyboard shortcuts

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