db

package
v0.0.0-...-ac0b00a Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBatchAlreadyClosed = errors.New("batch already closed")
)

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type InsertUUIDResultBatchResults

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

func (*InsertUUIDResultBatchResults) Close

func (*InsertUUIDResultBatchResults) QueryRow

func (b *InsertUUIDResultBatchResults) QueryRow(f func(int, pgtype.UUID, error))

type InsertUUIDResultParams

type InsertUUIDResultParams struct {
	ID               pgtype.UUID
	IDIdx            string
	Version          int16
	InsertDurationNs pgtype.Int8
	LookupDurationNs pgtype.Int8
}

type InsertUUIDv4BulkBatchResults

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

func (*InsertUUIDv4BulkBatchResults) Close

func (*InsertUUIDv4BulkBatchResults) QueryRow

func (b *InsertUUIDv4BulkBatchResults) QueryRow(f func(int, pgtype.UUID, error))

type InsertUUIDv4BulkParams

type InsertUUIDv4BulkParams struct {
	ID      pgtype.UUID
	Created pgtype.Timestamp
}

type InsertUUIDv7BulkBatchResults

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

func (*InsertUUIDv7BulkBatchResults) Close

func (*InsertUUIDv7BulkBatchResults) QueryRow

func (b *InsertUUIDv7BulkBatchResults) QueryRow(f func(int, pgtype.UUID, error))

type InsertUUIDv7BulkParams

type InsertUUIDv7BulkParams struct {
	ID      pgtype.UUID
	IDBrin  pgtype.UUID
	Created pgtype.Timestamp
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GenerateSeries

func (q *Queries) GenerateSeries(ctx context.Context) ([]pgtype.Timestamp, error)

casting resolves computation requirement https://github.com/sqlc-dev/sqlc/issues/1995

func (*Queries) GetUUIDv4

func (q *Queries) GetUUIDv4(ctx context.Context, id pgtype.UUID) (UuidV4, error)

func (*Queries) GetUUIDv7

func (q *Queries) GetUUIDv7(ctx context.Context, id pgtype.UUID) (UuidV7, error)

func (*Queries) GetUUIDv7BRIN

func (q *Queries) GetUUIDv7BRIN(ctx context.Context, idBrin pgtype.UUID) (UuidV7, error)

func (*Queries) InsertUUIDResult

func (*Queries) InsertUUIDv4Bulk

func (*Queries) InsertUUIDv7Bulk

func (*Queries) TruncateUUIDResult

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

func (*Queries) TruncateUUIDv4

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

func (*Queries) TruncateUUIDv7

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

func (*Queries) WithTx

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

type UuidResult

type UuidResult struct {
	ID               pgtype.UUID
	IDIdx            string
	Version          int16
	InsertDurationNs pgtype.Int8
	LookupDurationNs pgtype.Int8
}

type UuidV4

type UuidV4 struct {
	ID      pgtype.UUID
	Created pgtype.Timestamp
}

type UuidV7

type UuidV7 struct {
	ID      pgtype.UUID
	IDBrin  pgtype.UUID
	Created pgtype.Timestamp
}

Jump to

Keyboard shortcuts

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