Sign in

    superbigcup325/moonlake/types does not have a README file

    SqlError

    pub(all) suberror SqlError {
    Parse(String)
    Bind(String)
    Scan(String)
    Execute(String)
    } derive(Eq,
    Debug
    )

    Structured error: one variant per pipeline stage carrying the reason.
    impl Show for SqlError

    SqlError::equal

    fn SqlError::equal(SqlError, SqlError) -> Bool

    SqlError::message

    fn SqlError::message(self : SqlError) -> String

    SqlError::not_equal

    fn SqlError::not_equal(x : SqlError, y : SqlError) -> Bool

    SqlError::output

    fn SqlError::output(self : SqlError, logger : &Logger) -> Unit

    SqlError::stage

    fn SqlError::stage(self : SqlError) -> String

    SqlError::to_repr

    SqlError::to_string

    fn SqlError::to_string(self : SqlError) -> String

    ArithOp

    pub(all) enum ArithOp {
    Add
    Sub
    Mul
    Div
    Mod
    } derive(Eq,
    Debug
    )

    ArithOp::equal

    fn ArithOp::equal(ArithOp, ArithOp) -> Bool

    ArithOp::not_equal

    fn ArithOp::not_equal(x : ArithOp, y : ArithOp) -> Bool

    ArithOp::to_repr

    CmpOp

    pub(all) enum CmpOp {
    Eq
    Neq
    Lt
    Le
    Gt
    Ge
    } derive(Eq,
    Debug
    )

    CmpOp::apply

    fn CmpOp::apply(self : CmpOp, ord : Int?) -> Scalar

    Apply a comparison operator to a three-valued ordering result (Scalar::compare output): None ordering stays NULL.

    CmpOp::equal

    fn CmpOp::equal(CmpOp, CmpOp) -> Bool

    CmpOp::flip

    fn CmpOp::flip(self : CmpOp) -> CmpOp

    The operator that compares swapped operands: a < b is b.flip > a.

    CmpOp::not_equal

    fn CmpOp::not_equal(x : CmpOp, y : CmpOp) -> Bool

    CmpOp::to_repr

    ColumnVector

    pub(all) enum ColumnVector {
    I32(FixedArray[Int], FixedArray[Bool])
    I64(FixedArray[Int64], FixedArray[Bool])
    F64(FixedArray[Double], FixedArray[Bool])
    BoolV(FixedArray[Bool], FixedArray[Bool])
    StrV(FixedArray[String], FixedArray[Bool])
    DateV(FixedArray[Int], FixedArray[Bool])
    }

    ColumnVector::dtype

    fn ColumnVector::dtype(self : ColumnVector) -> DataType

    ColumnVector::get

    fn ColumnVector::get(self : ColumnVector, i : Int) -> Scalar

    Element access with validity: invalid slots come back as Null.

    ColumnVector::len

    fn ColumnVector::len(self : ColumnVector) -> Int

    ColumnVector::make

    fn ColumnVector::make(dtype : DataType, n : Int) -> ColumnVector

    Allocate an all-valid vector of the given type and length.

    ColumnVector::set

    fn ColumnVector::set(self : ColumnVector, i : Int, v : Scalar) -> Unit

    Write a scalar at position i. Writing Null marks the slot invalid. Type must match the vector (caller responsibility, binder-checked).

    DataBatch

    pub struct DataBatch {
    columns : Array[ColumnVector]
    row_count : Int
    }

    A chunk of rows in column form.

    DataBatch::columns

    fn DataBatch::columns(self : DataBatch) -> Array[ColumnVector]

    DataBatch::from_spill_bytes

    fn DataBatch::from_spill_bytes(buf : Bytes) -> Array[DataBatch] raise SqlError

    Deserialize batches from the spill wire format. A corrupt buffer is an Execute error; spill files never outlive the process, so earlier versions (MLSPILL1, MLSPILL2) are rejected by the magic rather than read.

    DataBatch::new

    fn DataBatch::new(columns : Array[ColumnVector], row_count : Int) -> DataBatch

    DataBatch::row_count

    fn DataBatch::row_count(self : DataBatch) -> Int

    DataBatch::to_spill_bytes

    fn DataBatch::to_spill_bytes(batches : Array[DataBatch]) -> Bytes raise SqlError

    Serialize batches into the spill wire format.

    DataType

    pub(all) enum DataType {
    Int32
    Int64
    Float64
    Str
    Bool
    Date
    } derive(Eq,
    Debug
    )

    Column data types supported by the engine (v1).

    DataType::equal

    fn DataType::equal(DataType, DataType) -> Bool

    DataType::not_equal

    fn DataType::not_equal(x : DataType, y : DataType) -> Bool

    DataType::to_repr

    DataType::to_string

    fn DataType::to_string(self : DataType) -> String

    Scalar

    pub(all) enum Scalar {
    Null
    Boolean(Bool)
    Int32(Int)
    Int64(Int64)
    Float64(Double)
    Str(String)
    Date(Int)
    } derive(Eq,
    Debug
    )

    A single value. Null participates in three-valued logic (see compare and logic helpers below).

    Scalar::arith

    fn Scalar::arith(op : ArithOp, a : Scalar, b : Scalar) -> Scalar

    Arithmetic with NULL propagation. Operand types must match (binder inserts Promote nodes to unify them beforehand). Division follows DuckDB: / is true division and always yields Float64 (the binder promotes both sides), so a zero divisor is IEEE ±inf (0/0 is nan), not an error; % is C fmod — the result takes the dividend's sign — and x % 0 is NULL.

    Scalar::compare

    fn Scalar::compare(a : Scalar, b : Scalar) -> Int?

    Three-valued comparison: Some(-1|0|1), or None when either side is Null or the types do not compare (binder guarantees matching types).

    Scalar::compare_nn

    fn Scalar::compare_nn(a : Scalar, b : Scalar) -> Int

    Non-null total compare: -1|0|1, or 0 when the values do not compare (binder guarantees matching types). Callers that pre-filter NULL — sort comparators, min/max folds — use this instead of Scalar::compare to avoid an Option allocation per comparison.

    Scalar::equal

    fn Scalar::equal(Scalar, Scalar) -> Bool

    Scalar::logic_and

    fn Scalar::logic_and(a : Scalar, b : Scalar) -> Scalar

    Three-valued AND: false dominates.

    Scalar::logic_not

    fn Scalar::logic_not(a : Scalar) -> Scalar

    Scalar::logic_or

    fn Scalar::logic_or(a : Scalar, b : Scalar) -> Scalar

    Three-valued OR: true dominates.

    Scalar::not_equal

    fn Scalar::not_equal(x : Scalar, y : Scalar) -> Bool

    Scalar::to_repr

    Scalar::to_string

    fn Scalar::to_string(self : Scalar) -> String

    add_months

    fn add_months(days : Int, n : Int) -> Int

    Shift epoch days by n calendar months (a year is 12 months), clamping the day of month to the target month's length (Jan 31 + 1 month = Feb 28; 1996-03-31 + 1 month = 1996-04-30).

    civil_from_days

    fn civil_from_days(z : Int) -> (Int, Int, Int)

    days_from_civil

    fn days_from_civil(y : Int, m : Int, d : Int) -> Int

    epoch_day

    fn epoch_day(days : Int) -> Int

    epoch_month

    fn epoch_month(days : Int) -> Int

    epoch_to_string

    fn epoch_to_string(days : Int) -> String

    epoch_year

    fn epoch_year(days : Int) -> Int

    Calendar field extraction from epoch days (EXTRACT support).

    parse_bool

    fn parse_bool(s : String) -> Bool?

    parse_bool_bytes

    fn parse_bool_bytes(buf : Bytes, start : Int, end : Int) -> Bool?

    parse_date

    fn parse_date(s : String) -> Int?

    Strict ISO parse: "yyyy-mm-dd" with real calendar validation. Returns epoch days, or None on any malformed input.

    parse_date_bytes

    fn parse_date_bytes(buf : Bytes, start : Int, end : Int) -> Int?

    Strict ISO "yyyy-mm-dd" over a byte range, mirroring parse_date.

    parse_f64

    fn parse_f64(s : String) -> Double?

    [sign] digits [ . digits ] [ (e|E) [sign] digits ], else None. Digits accumulate in Double — an Int64 accumulator would wrap exactly the way this parser exists to prevent — so arbitrarily long inputs degrade to the nearest float64 instead of flipping sign.

    parse_f64_bytes

    fn parse_f64_bytes(buf : Bytes, start : Int, end : Int) -> Double?

    parse_i32

    fn parse_i32(s : String) -> Int?

    Optional sign then digits, else None, range-checked to int32: a value outside [-2^31, 2^31-1] returns None so callers promote or report instead of wrapping silently.

    parse_i32_bytes

    fn parse_i32_bytes(buf : Bytes, start : Int, end : Int) -> Int?

    parse_i64

    fn parse_i64(s : String) -> Int64?

    Optional sign then digits, else None, range-checked to int64. Accumulates as a negative magnitude — -2^63 is representable while +2^63 is not, so negating at the end stays exact.

    parse_i64_bytes

    fn parse_i64_bytes(buf : Bytes, start : Int, end : Int) -> Int64?