expr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package expr holds engine-internal binding and coercion helpers that operate on the public cosma/expr tree. The user-facing AST, op types, and fluent builders live in cosma/expr; only logic that is not part of the public contract — literal type promotion against a bound schema — stays here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PromoteLiterals

func PromoteLiterals(e expr.Expr, s *schema.Schema) (expr.Expr, error)

PromoteLiterals retypes default-inferred numeric literals so they match a sibling column's resolved type within BinaryNode operands. It exists so callers can write `Col("ids:int32").Gt(Lit(2))` without explicitly writing Int32(2) — the literal 2 infers to Int64 and without this pass would mismatch the int32 column at the kernel.

The pass is conservative: it only retypes a LiteralNode when its sibling resolves to a single, distinct numeric type via the schema. Lit-vs-Lit and column-vs-column nodes are left alone — downstream type checking surfaces those.

Types

This section is empty.

Jump to

Keyboard shortcuts

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