nested

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBQuerier

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

func NewQuerier

func NewQuerier(conn genericConn) *DBQuerier

NewQuerier creates a DBQuerier that implements Querier. conn is typically *pgx.Conn, pgx.Tx, or *pgxpool.Pool.

func (*DBQuerier) ArrayNested2

func (q *DBQuerier) ArrayNested2(ctx context.Context) ([]ProductImageType, error)

ArrayNested2 implements Querier.ArrayNested2.

func (*DBQuerier) ArrayNested2Batch

func (q *DBQuerier) ArrayNested2Batch(batch genericBatch)

ArrayNested2Batch implements Querier.ArrayNested2Batch.

func (*DBQuerier) ArrayNested2Scan

func (q *DBQuerier) ArrayNested2Scan(results pgx.BatchResults) ([]ProductImageType, error)

ArrayNested2Scan implements Querier.ArrayNested2Scan.

func (*DBQuerier) Nested3

func (q *DBQuerier) Nested3(ctx context.Context) ([]ProductImageSetType, error)

Nested3 implements Querier.Nested3.

func (*DBQuerier) Nested3Batch

func (q *DBQuerier) Nested3Batch(batch genericBatch)

Nested3Batch implements Querier.Nested3Batch.

func (*DBQuerier) Nested3Scan

func (q *DBQuerier) Nested3Scan(results pgx.BatchResults) ([]ProductImageSetType, error)

Nested3Scan implements Querier.Nested3Scan.

type Dimensions

type Dimensions struct {
	Width  int `json:"width"`
	Height int `json:"height"`
}

Dimensions represents the Postgres composite type "dimensions".

type ProductImageSetType

type ProductImageSetType struct {
	Name      string             `json:"name"`
	OrigImage ProductImageType   `json:"orig_image"`
	Images    []ProductImageType `json:"images"`
}

ProductImageSetType represents the Postgres composite type "product_image_set_type".

type ProductImageType

type ProductImageType struct {
	Source     string     `json:"source"`
	Dimensions Dimensions `json:"dimensions"`
}

ProductImageType represents the Postgres composite type "product_image_type".

type Querier

type Querier interface {
	ArrayNested2(ctx context.Context) ([]ProductImageType, error)
	// ArrayNested2Batch enqueues a ArrayNested2 query into batch to be executed
	// later by the batch.
	ArrayNested2Batch(batch genericBatch)
	// ArrayNested2Scan scans the result of an executed ArrayNested2Batch query.
	ArrayNested2Scan(results pgx.BatchResults) ([]ProductImageType, error)

	Nested3(ctx context.Context) ([]ProductImageSetType, error)
	// Nested3Batch enqueues a Nested3 query into batch to be executed
	// later by the batch.
	Nested3Batch(batch genericBatch)
	// Nested3Scan scans the result of an executed Nested3Batch query.
	Nested3Scan(results pgx.BatchResults) ([]ProductImageSetType, error)
}

Querier is a typesafe Go interface backed by SQL queries.

Methods ending with Batch enqueue a query to run later in a pgx.Batch. After calling SendBatch on pgx.Conn, pgxpool.Pool, or pgx.Tx, use the Scan methods to parse the results.

Jump to

Keyboard shortcuts

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