Provides minisql sql expressions facilities for this project.
Package: minisql.sql.expressions
Reachable from entry: yes
minisql/common/endian.mlasendian→ src/minisql/common/endian.mlminisql/sql/types.mlastypes→ src/minisql/sql/types.mlminisql/sql/values.mlasvalues→ src/minisql/sql/values.mlstd/bytes.mlasbytes_api→../MiniLangCompilerML/std/bytes.ml— external dependencystd/math.mlasmath→../MiniLangCompilerML/std/math.ml— external dependency
function absoluteValue(value)Returns the absolute value while preserving full-width signed integer semantics.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function aggregate(name, argument, separator, distinct, typeInfo, countStar)Implements aggregate for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
dynamic |
— | Name of the affected item. |
argument |
dynamic |
— | argument value consumed by this operation. |
separator |
dynamic |
— | separator value consumed by this operation. |
distinct |
dynamic |
— | distinct value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
countStar |
dynamic |
— | countStar value consumed by this operation. |
function asciiCase(value, upper)Applies ASCII case conversion while preserving every non-ASCII UTF-8 byte.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
upper |
dynamic |
— | upper value consumed by this operation. |
function betweenPredicate(operand, lower, upper, negated)Implements between predicate for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operand |
dynamic |
— | operand value consumed by this operation. |
lower |
dynamic |
— | lower value consumed by this operation. |
upper |
dynamic |
— | upper value consumed by this operation. |
negated |
dynamic |
— | negated value consumed by this operation. |
function binary(operator, left, right, typeInfo)Implements binary for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operator |
dynamic |
— | operator value consumed by this operation. |
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
const BINDING_ERROR = 9020Defines the binding error constant used by the minisql sql expressions module.
const BOUND_AGGREGATE = 6Defines the bound aggregate constant used by the minisql sql expressions module.
const BOUND_BETWEEN = 11Defines the bound between constant used by the minisql sql expressions module.
const BOUND_BINARY = 4Defines the bound binary constant used by the minisql sql expressions module.
const BOUND_CASE = 7Defines the bound case constant used by the minisql sql expressions module.
const BOUND_CAST = 8Defines the bound cast constant used by the minisql sql expressions module.
const BOUND_COLUMN = 2Defines the bound column constant used by the minisql sql expressions module.
const BOUND_IN = 10Defines the bound in constant used by the minisql sql expressions module.
const BOUND_IS_NULL = 5Defines the bound is null constant used by the minisql sql expressions module.
const BOUND_LITERAL = 1Defines the bound literal constant used by the minisql sql expressions module.
const BOUND_SCALAR = 9Defines the bound scalar constant used by the minisql sql expressions module.
const BOUND_SUBQUERY = 14Defines the bound subquery constant used by the minisql sql expressions module.
const BOUND_TRUTH_TEST = 12Defines the bound truth test constant used by the minisql sql expressions module.
const BOUND_UNARY = 3Defines the bound unary constant used by the minisql sql expressions module.
const BOUND_WINDOW = 13Defines the bound window constant used by the minisql sql expressions module.
- minisql.sql.expressions.BoundAggregate — struct
- minisql.sql.expressions.BoundBetween — struct
- minisql.sql.expressions.BoundCase — struct
- minisql.sql.expressions.BoundCaseBranch — struct
- minisql.sql.expressions.BoundCast — struct
- minisql.sql.expressions.BoundExpression — struct
- minisql.sql.expressions.BoundIn — struct
- minisql.sql.expressions.BoundScalar — struct
- minisql.sql.expressions.BoundSubquery — struct
- minisql.sql.expressions.BoundTruthTest — struct
- minisql.sql.expressions.BoundWindow — struct
function bytesMatchAt(source, needle, offset)Returns whether needle occurs in source at the supplied byte offset.
| Parameter | Type | Default | Description |
|---|---|---|---|
source |
dynamic |
— | source value consumed by this operation. |
needle |
dynamic |
— | needle value consumed by this operation. |
offset |
dynamic |
— | Zero-based offset at which processing starts. |
function caseBranch(condition, result)Implements case branch for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
condition |
dynamic |
— | condition value consumed by this operation. |
result |
dynamic |
— | Result object populated or inspected by the operation. |
function caseExpression(branches, elseExpression, typeInfo)Implements case expression for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
branches |
dynamic |
— | branches value consumed by this operation. |
elseExpression |
dynamic |
— | elseExpression value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
function castExpression(operand, targetType)Casts expression using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operand |
dynamic |
— | operand value consumed by this operation. |
targetType |
dynamic |
— | targetType value consumed by this operation. |
function checkPasses(expression, context)Checks passes using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function civilDateFromEpochDays(days)Converts days since 1970-01-01 to Gregorian year, month and day.
| Parameter | Type | Default | Description |
|---|---|---|---|
days |
dynamic |
— | days value consumed by this operation. |
function column(index, typeInfo)Implements column for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
index |
dynamic |
— | Zero-based index of the affected item. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
function comparisonResult(left, right, operator)Implements comparison result for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
operator |
dynamic |
— | operator value consumed by this operation. |
function componentName()Performs the componentName operation for the minisql sql expressions module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function containsAggregate(expression)Returns whether the supplied value satisfies the aggregate condition. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
function containsSubquery(expression)Returns true when an expression tree contains a row-dependent nested SELECT.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
function containsSubqueryList(items)Returns true when at least one expression in a list contains a subquery.
| Parameter | Type | Default | Description |
|---|---|---|---|
items |
dynamic |
— | Items consumed or updated by the operation. |
function containsWindow(expression)Returns whether the supplied value satisfies the window condition. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
function containsWindowList(items)Returns whether the supplied value satisfies the window list condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
items |
dynamic |
— | Items consumed or updated by the operation. |
function evaluate(expression, context)Evaluates evaluate using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function evaluateBetween(expression, context)Evaluates between using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function evaluateCase(expression, context)Evaluates case using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function evaluateIn(expression, context)Evaluates in using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function evaluateScalar(expression, context)Evaluates scalar using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function evaluateScalarValues(expression, arguments)Evaluates a scalar after its arguments have already been evaluated. This entry point is also used by grouped expressions containing aggregates.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
arguments |
dynamic |
— | arguments value consumed by this operation. |
function evaluateTruthTest(expression, context)Evaluates truth test using the supplied inputs. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function fail(code, operation, message)Performs the fail operation for the minisql sql expressions module. Returns its result or propagates a structured error from validation or a dependency. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
code |
dynamic |
— | code value consumed by this operation. |
operation |
dynamic |
— | operation value consumed by this operation. |
message |
dynamic |
— | Human-readable message associated with the operation. |
function inPredicate(operand, candidates, negated)Implements in predicate for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operand |
dynamic |
— | operand value consumed by this operation. |
candidates |
dynamic |
— | candidates value consumed by this operation. |
negated |
dynamic |
— | negated value consumed by this operation. |
function integerDivide(left, right)Computes exact floor division for native integers.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
const INVALID_ARGUMENT = 9001Defines the invalid argument constant used by the minisql sql expressions module.
function isBaseBoundExpression(value)Returns whether the supplied value satisfies the base bound expression condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundAggregate(value)Returns whether the supplied value satisfies the bound aggregate condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundBetween(value)Returns whether the supplied value satisfies the bound between condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundCase(value)Returns whether the supplied value satisfies the bound case condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundCast(value)Returns whether the supplied value satisfies the bound cast condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundExpression(value)Returns whether the supplied value satisfies the bound expression condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundIn(value)Returns whether the supplied value satisfies the bound in condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundLiteral(value)Returns whether the supplied value satisfies the bound literal condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundScalar(value)Returns whether the supplied value satisfies the bound scalar condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundSubquery(value)Returns whether a bound expression defers a nested SELECT to row evaluation.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundTruthTest(value)Returns whether the supplied value satisfies the bound truth test condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isBoundWindow(value)Returns whether the supplied value satisfies the bound window condition. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
function isImplemented()Returns whether implemented satisfies the condition required by the minisql sql expressions module. Returns the computed value or operation status. Does not modify its inputs.
function isNull(operand, negated)Returns whether the supplied value satisfies the null condition. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.
| Parameter | Type | Default | Description |
|---|---|---|---|
operand |
dynamic |
— | operand value consumed by this operation. |
negated |
dynamic |
— | negated value consumed by this operation. |
function likeResult(left, right)Implements like result for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
function literal(value, typeInfo)Implements literal for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | Value consumed or transformed by the operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
function numericResult(left, right, operator, resultType)Implements numeric result for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
operator |
dynamic |
— | operator value consumed by this operation. |
resultType |
dynamic |
— | resultType value consumed by this operation. |
function predicatePasses(expression, context)Implements predicate passes for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
context |
dynamic |
— | Context that carries state for the operation. |
function referencesColumnAtOrAfter(expression, minimumIndex)Implements references column at or after for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
expression |
dynamic |
— | expression value consumed by this operation. |
minimumIndex |
dynamic |
— | Zero-based index of minimum. |
function replaceText(sourceText, searchText, replacementText)Replaces all non-overlapping UTF-8 byte sequences without changing unaffected bytes.
| Parameter | Type | Default | Description |
|---|---|---|---|
sourceText |
dynamic |
— | sourceText value consumed by this operation. |
searchText |
dynamic |
— | searchText value consumed by this operation. |
replacementText |
dynamic |
— | replacementText value consumed by this operation. |
function rowContext(rowValues)Implements row context for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
rowValues |
dynamic |
— | rowValues value consumed by this operation. |
- minisql.sql.expressions.RowContext — struct
function sameBinding(left, right)Implements same binding for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
left |
dynamic |
— | left value consumed by this operation. |
right |
dynamic |
— | right value consumed by this operation. |
function scalar(name, arguments, typeInfo)Implements scalar for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
dynamic |
— | Name of the affected item. |
arguments |
dynamic |
— | arguments value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
function subquery(subqueryKind, query, operand, negated, typeInfo)Creates a deferred subquery binding after its shape and result type have been validated.
| Parameter | Type | Default | Description |
|---|---|---|---|
subqueryKind |
dynamic |
— | subqueryKind value consumed by this operation. |
query |
dynamic |
— | query value consumed by this operation. |
operand |
dynamic |
— | operand value consumed by this operation. |
negated |
dynamic |
— | negated value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
const SUBQUERY_EXISTS = 2Defines the subquery exists constant used by the minisql sql expressions module.
const SUBQUERY_IN = 3Defines the subquery in constant used by the minisql sql expressions module.
const SUBQUERY_SCALAR = 1Defines the subquery scalar constant used by the minisql sql expressions module.
function targetMilestone()Performs the targetMilestone operation for the minisql sql expressions module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
function truthTest(operand, expected, negated)Implements truth test for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operand |
dynamic |
— | operand value consumed by this operation. |
expected |
dynamic |
— | expected value consumed by this operation. |
negated |
dynamic |
— | negated value consumed by this operation. |
const TYPE_MISMATCH = 9017Defines the type mismatch constant used by the minisql sql expressions module.
function unary(operator, operand, typeInfo)Implements unary for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
operator |
dynamic |
— | operator value consumed by this operation. |
operand |
dynamic |
— | operand value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |
function utf8ByteOffset(raw, characterIndex)Maps a zero-based Unicode character index to a UTF-8 byte offset.
| Parameter | Type | Default | Description |
|---|---|---|---|
raw |
dynamic |
— | raw value consumed by this operation. |
characterIndex |
dynamic |
— | Zero-based index of character. |
function utf8CharacterCount(raw)Counts Unicode scalar starts in validated UTF-8 text.
| Parameter | Type | Default | Description |
|---|---|---|---|
raw |
dynamic |
— | raw value consumed by this operation. |
function window(name, arguments, partitionBy, orderBy, descending, nullsFirst, nullsSpecified, typeInfo)Implements window for this module. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.
| Parameter | Type | Default | Description |
|---|---|---|---|
name |
dynamic |
— | Name of the affected item. |
arguments |
dynamic |
— | arguments value consumed by this operation. |
partitionBy |
dynamic |
— | partitionBy value consumed by this operation. |
orderBy |
dynamic |
— | orderBy value consumed by this operation. |
descending |
dynamic |
— | descending value consumed by this operation. |
nullsFirst |
dynamic |
— | nullsFirst value consumed by this operation. |
nullsSpecified |
dynamic |
— | nullsSpecified value consumed by this operation. |
typeInfo |
dynamic |
— | typeInfo value consumed by this operation. |