Skip to content

Latest commit

 

History

History
695 lines (438 loc) · 28.2 KB

File metadata and controls

695 lines (438 loc) · 28.2 KB

src/minisql/sql/values.ml

Home · Files

Provides minisql sql values facilities for this project.

Package: minisql.sql.values

Reachable from entry: yes

Imports

Declarations

asInt64

function asInt64(value)

Implements as int64 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
value dynamic Value consumed or transformed by the operation.

View source

asNumber

function asNumber(value)

Implements as number for this module. Requires arguments that satisfy the validation performed below. 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
value dynamic Value consumed or transformed by the operation.

View source

binary

function binary(value)

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
value dynamic Value consumed or transformed by the operation.

View source

BINDING_ERROR

const BINDING_ERROR = 9020

Defines the binding error constant used by the minisql sql values module.

View source

boolean

function boolean(value)

Implements boolean 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
value dynamic Value consumed or transformed by the operation.

View source

cast

function cast(value, target)

Casts cast 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
value dynamic Value consumed or transformed by the operation.
target dynamic target value consumed by this operation.

View source

compareNonNull

function compareNonNull(left, right)

Compares non null using the supplied inputs. Requires arguments that satisfy the validation performed below. Returns the computed value or operation status. Does not modify its inputs.

Parameter Type Default Description
left dynamic left value consumed by this operation.
right dynamic right value consumed by this operation.

View source

componentName

function componentName()

Performs the componentName operation for the minisql sql values module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.

View source

CONSTRAINT_VIOLATION

const CONSTRAINT_VIOLATION = 9021

Defines the constraint violation constant used by the minisql sql values module.

View source

convert

function convert(value, target)

Converts convert using the supplied inputs. Requires arguments that satisfy the validation performed below. 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
value dynamic Value consumed or transformed by the operation.
target dynamic target value consumed by this operation.

View source

decimalLiteral

function decimalLiteral(textValue, precision, scale)

Implements decimal 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
textValue dynamic textValue value consumed by this operation.
precision dynamic precision value consumed by this operation.
scale dynamic scale value consumed by this operation.

View source

decimalPower10

function decimalPower10(exponent)

Implements decimal power10 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
exponent dynamic exponent value consumed by this operation.

View source

decimalWordsFromText

function decimalWordsFromText(textValue, precision, scale)

Parse a decimal spelling into the exact signed scaled integer used by the row format. No binary floating-point arithmetic, rounding or truncation is used. Values with more non-zero fractional digits than the declared scale are rejected instead of silently changing the user's input. Implements decimal words from text 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
textValue dynamic textValue value consumed by this operation.
precision dynamic precision value consumed by this operation.
scale dynamic scale value consumed by this operation.

View source

decimalWordsFromValue

function decimalWordsFromValue(value, target)

Implements decimal words from value for this module. Requires arguments that satisfy the validation performed below. 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
value dynamic Value consumed or transformed by the operation.
target dynamic target value consumed by this operation.

View source

doubleValue

function doubleValue(value)

Implements double value 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
value dynamic Value consumed or transformed by the operation.

View source

fail

function fail(code, operation, message)

Performs the fail operation for the minisql sql values 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.

View source

floatingNumberFromText

function floatingNumberFromText(textValue)

MiniLang's native toNumber parser accepts ordinary decimal spellings but does not accept scientific notation. SQL approximate-number literals do, so split an optional exponent and apply it explicitly. This keeps ordinary spellings on the compiler's well-tested conversion path while supporting forms such as 1.25e2, 1E-3 and a leading plus sign. Implements floating number from text 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
textValue dynamic textValue value consumed by this operation.

View source

floatingTextPart

function floatingTextPart(raw, startOffset, endOffset, operation)

Implements floating text part 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
raw dynamic raw value consumed by this operation.
startOffset dynamic startOffset value consumed by this operation.
endOffset dynamic endOffset value consumed by this operation.
operation dynamic operation value consumed by this operation.

View source

fromLiteral

function fromLiteral(expression)

Implements from literal 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.

View source

fromStorage

function fromStorage(typeKind, raw)

Implements from storage for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.

Parameter Type Default Description
typeKind dynamic typeKind value consumed by this operation.
raw dynamic raw value consumed by this operation.

View source

fromTruth

function fromTruth(value)

Implements from truth 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.

View source

int64Compare

function int64Compare(left, right)

Implements int64 compare 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.

View source

integer

function integer(value)

Implements integer 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
value dynamic Value consumed or transformed by the operation.

View source

INVALID_ARGUMENT

const INVALID_ARGUMENT = 9001

Defines the invalid argument constant used by the minisql sql values module.

View source

isImplemented

function isImplemented()

Returns whether implemented satisfies the condition required by the minisql sql values module. Returns the computed value or operation status. Does not modify its inputs.

View source

isNull

function isNull(value)

Returns whether the supplied value satisfies the null 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.

View source

isSqlValue

function isSqlValue(value)

Returns whether the supplied value satisfies the SQL value 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.

View source

literalFloat

function literalFloat(textValue)

Implements literal float 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
textValue dynamic textValue value consumed by this operation.

View source

literalInteger

function literalInteger(textValue)

Implements literal integer for this module. Requires arguments that satisfy the validation performed below. 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
textValue dynamic textValue value consumed by this operation.

View source

logicalAnd

function logicalAnd(left, right)

Implements logical and 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.

View source

logicalNot

function logicalNot(value)

Implements logical not 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.

View source

logicalOr

function logicalOr(left, right)

Implements logical or 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.

View source

nullValue

function nullValue(typeKind)

Implements null value 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
typeKind dynamic typeKind value consumed by this operation.

View source

of

function of(typeKind, value)

Implements of 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
typeKind dynamic typeKind value consumed by this operation.
value dynamic Value consumed or transformed by the operation.

View source

parseInt64

function parseInt64(textValue)

Parses int64 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
textValue dynamic textValue value consumed by this operation.

View source

targetMilestone

function targetMilestone()

Performs the targetMilestone operation for the minisql sql values module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.

View source

text

function text(value)

Implements text 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
value dynamic Value consumed or transformed by the operation.

View source

toStorage

function toStorage(value)

Implements to storage 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
value dynamic Value consumed or transformed by the operation.

View source

truth

function truth(value)

Implements truth 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
value dynamic Value consumed or transformed by the operation.

View source

TYPE_MISMATCH

const TYPE_MISMATCH = 9017

Defines the type mismatch constant used by the minisql sql values module.

View source

U32_BASE

const U32_BASE = 4294967296

Defines the u32 base constant used by the minisql sql values module.

View source

unsignedMagnitudeToSigned

function unsignedMagnitudeToSigned(high, low, negative)

Implements unsigned magnitude to signed for this module. Returns the computed value or operation status. Any side effects are limited to the explicitly invoked dependencies.

Parameter Type Default Description
high dynamic high value consumed by this operation.
low dynamic low value consumed by this operation.
negative dynamic negative value consumed by this operation.

View source

upperAscii

function upperAscii(value)

Implements upper ascii 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
value dynamic Value consumed or transformed by the operation.

View source