rowcodec

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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.

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