interp

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package interp is the reference interpreter for the committed read-path subset of the relalg IR. It implements docs/design/ir-semantics.md verbatim and serves as the oracle for the cross-provider differential conformance suite (internal/conformance). It is not a performance reference.

Index

Constants

This section is empty.

Variables

View Source
var ErrIncomparable = errors.New("interp: incomparable values")

ErrIncomparable is returned when two non-NULL values of incompatible types are compared. The conformance fixture is typed, so this always indicates a corpus or interpreter bug rather than a data condition.

View Source
var ErrUnknownColumn = errors.New("interp: unknown column")

ErrUnknownColumn is returned when an expression references a column the input relation does not have.

View Source
var ErrUnknownRelation = errors.New("interp: unknown relation")

ErrUnknownRelation is returned when a Scan references a table not present in the DB.

View Source
var ErrUnsupported = errors.New("interp: unsupported expression")

ErrUnsupported is returned for IR nodes outside the committed read-path subset (writes, procedures).

Functions

This section is empty.

Types

type DB

type DB map[string]Table

DB maps relation names to tables. Schema qualifiers are ignored: the conformance fixture lives in a single schema.

type Result

type Result struct {
	Cols []string
	Rows [][]any
}

Result is an evaluated relation: column names and positional rows.

func Eval

func Eval(db DB, e relalg.Expr) (Result, error)

Eval evaluates a committed read-path expression against db.

type Table

type Table struct {
	Cols []string
	Rows [][]any
}

Table is an in-memory base relation. Rows hold values in Cols order; cell values are nil, integers, floats, decimal strings are NOT allowed — use int64/float64/string/bool only, with numeric semantics per the spec.

Jump to

Keyboard shortcuts

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