mqpgx

package
v1.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mqpgx is the pgx/v5 adapter for metaquery builders. It executes a *metaquery.Builder and returns an untyped Result or a typed TypedResult[T].

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

Run executes b and returns every row as a positional []any in the same order as Meta.Columns. If b.WantsTotal(), a follow-up COUNT(*) is issued and Meta.Pagination.Total is populated.

func Scan

Scan executes b, scans rows into []T via pgx.RowToStructByName, and returns a TypedResult with the same Meta envelope as Run. T is validated against b.OutputColumns() before querying.

func ScanOne

func ScanOne[T any](ctx context.Context, q Queryer, b *metaquery.Builder) (T, metaquery.Meta, error)

ScanOne runs b expecting exactly one row and returns the scanned T plus the Meta envelope.

Types

type Queryer

type Queryer interface {
	Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error)
	QueryRow(ctx context.Context, sql string, args ...any) pgx.Row
}

Queryer is the minimal pgx surface the adapter needs. Implemented by *pgx.Conn, *pgxpool.Pool, pgx.Tx, etc.

Jump to

Keyboard shortcuts

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