readmeta

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: 5 Imported by: 0

Documentation

Overview

Package readmeta carries immutable evidence from actual typed SQL reads. It contains no row values, SQL execution, or binding policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

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

Fields records native mapped destination indexes for one actual read schema. Nil means unknown, not all fields. Loaded SQL NULL is still a loaded field.

func NewFields

func NewFields(rowType reflect.Type, indexes [][]int) *Fields

func (*Fields) Has

func (f *Fields) Has(name string) bool

Has resolves a Go selector through native shape, preserving promoted aliases without interpreting SQL tags or comparing scalar zero values.

func (*Fields) Known

func (f *Fields) Known() bool

type Record

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

Record describes one final row ordinal and its actual holder attachments. Source tokens remain inside the collector; no reconstructed view identity is exposed from incomplete structural metadata.

func NewRecord

func NewRecord(fields *Fields, relations map[string][]*Record) *Record

func (*Record) Fields

func (r *Record) Fields() *Fields

func (*Record) Relation

func (r *Record) Relation(holder string) ([]*Record, bool)

func (*Record) RelationRow

func (r *Record) RelationRow(holder string, index int) (*Record, error)

RelationRow returns immutable evidence without copying the sibling collection.

type Result

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

Result addresses root rows by final output ordinal. RootHolder is empty for direct outputs; a one-valued output has zero or one root record.

func NewResult

func NewResult(rootHolder string, direct bool, rows []*Record) *Result

func (*Result) DirectOutput

func (r *Result) DirectOutput() bool

func (*Result) Output

func (r *Result) Output(holder string) (*Result, error)

Output selects immutable evidence for an exact output holder. The existing Row/Rows methods continue to address only the main root view.

func (*Result) RootHolder

func (r *Result) RootHolder() string

func (*Result) Row

func (r *Result) Row(index int) (*Record, error)

Row returns immutable evidence in constant time without copying all roots.

func (*Result) Rows

func (r *Result) Rows() []*Record

func (*Result) WithOutputs

func (r *Result) WithOutputs(slots map[string][]*Record) (*Result, error)

WithOutputs composes completed output slots without mutating either result or caller-owned collections. Slots are canonical Go holder paths, not view aliases. A slot with no rows is known empty; unknown rows contain nil Fields.

Jump to

Keyboard shortcuts

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