unmbt/ciallo-orm/schema does not have a README file

    FromRow

    pub(open) trait FromRow {
    fn from_row(SqlRow) -> Self raise
    DataError

    }

    FromSqlValue

    pub(open) trait FromSqlValue {
    fn from_sql_value(SqlValue) -> Self raise
    DataError

    }

    ToSqlValue

    pub(open) trait ToSqlValue {
    fn to_sql_value(Self) -> SqlValue
    }

    impl ToSqlValue for Bool
    impl ToSqlValue for Int
    impl ToSqlValue for Int64
    impl ToSqlValue for Option[T]
    impl ToSqlValue for Bytes

    ColumnIndex

    pub struct ColumnIndex {
    // private fields
    } derive(Eq,
    Debug
    )

    Read-only shared column-name-to-index map built once per SQL result set. All SqlRow instances from the same query share one ColumnIndex for O(1) lookups.

    ColumnIndex::ColumnIndex

    fn ColumnIndex::ColumnIndex(columns : Array[String]) -> ColumnIndex

    ColumnIndex::columns

    fn ColumnIndex::columns(self : ColumnIndex) -> Array[String]

    ColumnIndex::index_of

    fn ColumnIndex::index_of(self : ColumnIndex, name : StringView) -> Int?

    ColumnIndex::matches_columns

    fn ColumnIndex::matches_columns(self : ColumnIndex, expected : Array[String]) -> Bool

    Returns true if this result set's columns match expected in exact positional order.

    JsonCol

    pub(all) struct JsonCol[T](T) derive(Eq,
    Debug
    )

    任意 ToJson/FromJson 类型自动桥接为 JSON/JSONB 列
    impl ToSqlValue for JsonCol[T]

    SqlRow

    pub struct SqlRow {
    columns : Array[String]
    values : Array[SqlValue]
    // private fields
    }

    按列索引或列名零反射读取的 SQL 行容器(支持多行共享只读 ColumnIndex 实现 O(1) 列查找)
    impl Eq for SqlRow

    SqlRow::SqlRow

    fn SqlRow::SqlRow(columns~ : Array[String], values~ : Array[SqlValue]) -> SqlRow

    SqlRow::decode_at

    fn[T : FromSqlValue] SqlRow::decode_at(self : SqlRow, index : Int) -> T raise
    DataError

    SqlRow::decode_by_name

    fn[T : FromSqlValue] SqlRow::decode_by_name(self : SqlRow, name : StringView) -> T raise
    DataError

    SqlRow::get_at

    fn SqlRow::get_at(self : SqlRow, index : Int) -> SqlValue raise
    DataError

    SqlRow::get_by_name

    fn SqlRow::get_by_name(self : SqlRow, name : StringView) -> SqlValue raise
    DataError

    SqlRow::matches_columns

    fn SqlRow::matches_columns(self : SqlRow, expected : Array[String]) -> Bool

    Returns true if this row's columns match expected in exact positional order, enabling O(1) decode_at(0), decode_at(1), ... fast paths without hash lookups.

    SqlRow::with_index

    fn SqlRow::with_index(index : ColumnIndex, values : Array[SqlValue]) -> SqlRow

    Constructs a SqlRow sharing an existing result-set ColumnIndex without copying columns.

    SqlValue

    pub(all) enum SqlValue {
    Null
    Bool(Bool)
    Int32(Int)
    Int64(Int64)
    Double(Double)
    Text(String)
    Bytes(Bytes)
    Json(
    Json
    )
    } derive(Eq,
    Debug
    )

    强类型 SQL 参数与结果单元格值(四目标纯核)

    Source Files