Skip to content

Latest commit

 

History

History
734 lines (451 loc) · 27.1 KB

File metadata and controls

734 lines (451 loc) · 27.1 KB

src/minisql/storage/row_codec.ml

Home · Files

Provides minisql storage row codec facilities for this project.

Package: minisql.storage.row_codec

Reachable from entry: yes

Imports

Declarations

bytesEqual

function bytesEqual(left, right)

Performs the bytesEqual operation for the minisql storage row codec module. Inputs: left, right. Returns the produced value or propagates a structured error from validation or delegated operations.

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

View source

column

function column(typeCode, nullable, maxLength, precision, scale)

Performs the column operation for this module. Inputs: typeCode, nullable, maxLength, precision, scale. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
typeCode dynamic typeCode value consumed by this operation.
nullable dynamic nullable value consumed by this operation.
maxLength dynamic maxLength value consumed by this operation.
precision dynamic precision value consumed by this operation.
scale dynamic scale value consumed by this operation.

View source

componentName

function componentName()

Performs the componentName operation for the minisql storage row codec module. Takes no caller-supplied inputs. Returns the produced value or propagates a structured error from validation or delegated operations.

View source

CORRUPT_DATA

const CORRUPT_DATA = 9004

Defines the corrupt data constant used by the minisql storage row codec module.

View source

decodeBinary

function decodeBinary(spec, encoded)

Decodes the binary. Inputs: spec, encoded. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
encoded dynamic encoded value consumed by this operation.

View source

decodeCompatible

function decodeCompatible(rowSchema, encoded)

Decodes the compatible. Inputs: rowSchema, encoded. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
rowSchema dynamic rowSchema value consumed by this operation.
encoded dynamic encoded value consumed by this operation.

View source

decodeRow

function decodeRow(rowSchema, encoded)

Decodes the row. Inputs: rowSchema, encoded. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
rowSchema dynamic rowSchema value consumed by this operation.
encoded dynamic encoded value consumed by this operation.

View source

decodeScalar

function decodeScalar(spec, encoded)

Decodes the scalar. Inputs: spec, encoded. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
encoded dynamic encoded value consumed by this operation.

View source

decodeText

function decodeText(spec, encoded)

Decodes the text. Inputs: spec, encoded. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
encoded dynamic encoded value consumed by this operation.

View source

DIRECTORY_ENTRY_SIZE

const DIRECTORY_ENTRY_SIZE = 8

Defines the directory entry size constant used by the minisql storage row codec module.

View source

encode

function encode(rowSchema, values)

Encodes encode for the minisql storage row codec workflow. Inputs: rowSchema, values. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
rowSchema dynamic rowSchema value consumed by this operation.
values dynamic values value consumed by this operation.

View source

encodeBinary

function encodeBinary(spec, value)

Encodes the binary. Inputs: spec, value. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
value dynamic Value consumed or transformed by the operation.

View source

encodeRow

function encodeRow(rowSchema, values)

Encodes the row. Inputs: rowSchema, values. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
rowSchema dynamic rowSchema value consumed by this operation.
values dynamic values value consumed by this operation.

View source

encodeScalar

function encodeScalar(spec, value)

Encodes the scalar. Inputs: spec, value. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
value dynamic Value consumed or transformed by the operation.

View source

encodeText

function encodeText(spec, value)

Encodes the text. Inputs: spec, value. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
spec dynamic spec value consumed by this operation.
value dynamic Value consumed or transformed by the operation.

View source

external

function external(encodedPointer)

Performs the external operation for this module. Inputs: encodedPointer. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
encodedPointer dynamic encodedPointer value consumed by this operation.

View source

fail

function fail(code, operation, message)

Performs the fail operation for the minisql storage row codec module. Inputs: code, operation, message. Returns the produced value or propagates a structured error from validation or delegated operations.

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

FLAG_EXTERNAL

const FLAG_EXTERNAL = 2

Defines the flag external constant used by the minisql storage row codec module.

View source

FLAG_NULL

const FLAG_NULL = 1

Defines the flag null constant used by the minisql storage row codec module.

View source

FORMAT_VERSION

const FORMAT_VERSION = 1

Defines the format version constant used by the minisql storage row codec module.

View source

HEADER_SIZE

const HEADER_SIZE = 16

Defines the header size constant used by the minisql storage row codec module.

View source

INVALID_ARGUMENT

const INVALID_ARGUMENT = 9001

Row format v1. SQL NULL is represented by SqlNull rather than MiniLang void,

View source

isBinaryType

function isBinaryType(typeCode)

Evaluates whether the supplied input satisfies the binary type predicate. Inputs: typeCode. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

Parameter Type Default Description
typeCode dynamic typeCode value consumed by this operation.

View source

isExternalType

function isExternalType(typeCode)

Evaluates whether the supplied input satisfies the external type predicate. Inputs: typeCode. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

Parameter Type Default Description
typeCode dynamic typeCode value consumed by this operation.

View source

isExternalValue

function isExternalValue(value)

Evaluates whether the supplied input satisfies the external value predicate. Inputs: value. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

Parameter Type Default Description
value dynamic Value consumed or transformed by the operation.

View source

isImplemented

function isImplemented()

Returns whether implemented satisfies the condition required by the minisql storage row codec module. Takes no caller-supplied inputs. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

View source

isNull

function isNull(value)

Evaluates whether the supplied input satisfies the null predicate. Inputs: value. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

Parameter Type Default Description
value dynamic Value consumed or transformed by the operation.

View source

isTextType

function isTextType(typeCode)

Evaluates whether the supplied input satisfies the text type predicate. Inputs: typeCode. Returns a boolean result; invalid input or delegated failures are reported as structured errors.

Parameter Type Default Description
typeCode dynamic typeCode value consumed by this operation.

View source

magicBytes

function magicBytes()

Performs the magicBytes operation for the minisql storage row codec module. Takes no caller-supplied inputs. Returns the produced value or propagates a structured error from validation or delegated operations.

View source

nullValue

function nullValue()

Performs the null value operation for this module. Takes no caller-supplied inputs. Returns the produced value or propagates a structured error from validation or delegated operations.

View source

schema

function schema(version, columns)

Performs the schema operation for this module. Inputs: version, columns. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
version dynamic version value consumed by this operation.
columns dynamic columns value consumed by this operation.

View source

targetMilestone

function targetMilestone()

Performs the targetMilestone operation for the minisql storage row codec module. Takes no caller-supplied inputs. Returns the produced value or propagates a structured error from validation or delegated operations.

View source

TYPE_BIGINT

const TYPE_BIGINT = 4

Defines the type bigint constant used by the minisql storage row codec module.

View source

TYPE_BINARY

const TYPE_BINARY = 11

Defines the type binary constant used by the minisql storage row codec module.

View source

TYPE_BLOB

const TYPE_BLOB = 13

Defines the type blob constant used by the minisql storage row codec module.

View source

TYPE_BOOLEAN

const TYPE_BOOLEAN = 1

Defines the type boolean constant used by the minisql storage row codec module.

View source

TYPE_CHAR

const TYPE_CHAR = 8

Defines the type char constant used by the minisql storage row codec module.

View source

TYPE_DATE

const TYPE_DATE = 14

Defines the type date constant used by the minisql storage row codec module.

View source

TYPE_DECIMAL

const TYPE_DECIMAL = 7

Defines the type decimal constant used by the minisql storage row codec module.

View source

TYPE_DOUBLE

const TYPE_DOUBLE = 6

Defines the type double constant used by the minisql storage row codec module.

View source

TYPE_INTEGER

const TYPE_INTEGER = 3

Defines the type integer constant used by the minisql storage row codec module.

View source

TYPE_MISMATCH

const TYPE_MISMATCH = 9017

Defines the type mismatch constant used by the minisql storage row codec module.

View source

TYPE_REAL

const TYPE_REAL = 5

Defines the type real constant used by the minisql storage row codec module.

View source

TYPE_SMALLINT

const TYPE_SMALLINT = 2

Defines the type smallint constant used by the minisql storage row codec module.

View source

TYPE_TEXT

const TYPE_TEXT = 10

Defines the type text constant used by the minisql storage row codec module.

View source

TYPE_TIME

const TYPE_TIME = 15

Defines the type time constant used by the minisql storage row codec module.

View source

TYPE_TIMESTAMP

const TYPE_TIMESTAMP = 16

Defines the type timestamp constant used by the minisql storage row codec module.

View source

TYPE_VARBINARY

const TYPE_VARBINARY = 12

Defines the type varbinary constant used by the minisql storage row codec module.

View source

TYPE_VARCHAR

const TYPE_VARCHAR = 9

Defines the type varchar constant used by the minisql storage row codec module.

View source

UNSUPPORTED_FORMAT

const UNSUPPORTED_FORMAT = 9003

Defines the unsupported format constant used by the minisql storage row codec module.

View source

validType

function validType(typeCode)

Performs the valid type operation for this module. Inputs: typeCode. Returns the produced value or propagates a structured error from validation or delegated operations.

Parameter Type Default Description
typeCode dynamic typeCode value consumed by this operation.

View source