rowcodec

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rowcodec compiles column codecs into typed SQLX scan wrappers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RowType    reflect.Type
	Columns    []*data.Column
	Factory    xcodec.Factory
	LookupType func(string) (reflect.Type, error)
	Resources  fs.FS
}

type Decoder

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

Decoder is per-query state. SQLX owns both scan destinations and cache bytes.

func (*Decoder) Decode

func (d *Decoder) Decode(ctx context.Context, row any) (any, error)

func (*Decoder) FieldIndexes

func (d *Decoder) FieldIndexes() ([][]int, error)

FieldIndexes translates the actual native scan mapping through this codec's already-compiled target accessors. Virtual Raw/Shadow wrapper fields never escape as model-field evidence.

func (*Decoder) NewRow

func (d *Decoder) NewRow() any

func (*Decoder) Observe

func (d *Decoder) Observe(columns []sqlxio.Column) error

Observe delegates field identity to SQLX's matcher; no mapping is replaced.

func (*Decoder) Rebind added in v1.1.0

func (d *Decoder) Rebind(row, actual any) error

Rebind points a buffered scan row at its final collector slot after a value slice may have grown. Decode still owns conversion and field assignment.

type Plan

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

Plan contains immutable source/destination contracts; Decode state is per read.

func Compile

func Compile(config Config) (*Plan, error)

func (*Plan) ModelType

func (p *Plan) ModelType() reflect.Type

func (*Plan) NewDecoder

func (p *Plan) NewDecoder(newActual func() any, options ...xcodec.Option) *Decoder

Jump to

Keyboard shortcuts

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