sql

package
v0.0.0-...-a1a1282 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 13 Imported by: 1 module, 1 package

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

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