sql

package
v0.0.0-...-23c868e Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileExpression

func CompileExpression(expr sqlparser.Expr) (expression.Expression, error)

CompileExpression compiles a SQL expression AST into a DBSP expression.

func CompilePredicate

func CompilePredicate(expr sqlparser.Expr, bindVars map[string]*querypb.BindVariable) (expression.Expression, error)

CompilePredicate compiles a SQL predicate using SQL NULL semantics.

Types

type Compiler

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

Compiler compiles SQL statements into DBSP circuits.

func New

func New(db *relation.Database) *Compiler

New creates a new SQL compiler with the given catalog.

func (*Compiler) Compile

func (c *Compiler) Compile(ir compiler.IR) (*compiler.Query, error)

Compile compiles parsed SQL IR into a DBSP query.

func (*Compiler) CompileString

func (c *Compiler) CompileString(source string) (*compiler.Query, error)

CompileString is a convenience wrapper that parses then compiles.

func (*Compiler) Parse

func (c *Compiler) Parse(source []byte) (compiler.IR, error)

Parse parses SQL source into normalized SQL IR.

func (*Compiler) ParseString

func (c *Compiler) ParseString(source string) (compiler.IR, error)

ParseString parses SQL source into normalized SQL IR.

type NormalizedQuery

type NormalizedQuery struct {
	Stmt     *sqlparser.Select
	BindVars map[string]*querypb.BindVariable
}

NormalizedQuery holds a normalized AST and bind vars.

func Normalize

func Normalize(source string, db *relation.Database) (*NormalizedQuery, error)

Normalize parses and normalizes SQL into a canonical subset. It rewrites aliases, expands stars, and rejects unsupported syntax.

func (*NormalizedQuery) IRKind

func (n *NormalizedQuery) IRKind() string

type UnimplementedError

type UnimplementedError struct {
	Feature string
}

UnimplementedError indicates a SQL feature not yet supported.

func (UnimplementedError) Error

func (e UnimplementedError) Error() string

Jump to

Keyboard shortcuts

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