mz_repr/
lib.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Fundamental data representation.
11//!
12//! This module contains the types for representing data in Materialize that all
13//! layers of the stack can understand. Think of it as the _lingua franca_:
14//! individual layers may use different representations internally, but they all
15//! agree to use this representation at their boundaries.
16//!
17//! * The core value type is the [`Datum`] enum, which represents a literal value.
18//! * [`Row`] extends a `Datum` horizontally, and has features for efficiently
19//!   doing so.
20//! * [`RelationDesc`] describes what it takes to extend a `Row` vertically, and
21//!   corresponds most closely to what is returned from querying our dataflows
22
23#![warn(missing_debug_implementations)]
24// TODO(parkmycar): Remove this allow.
25#![allow(unsafe_op_in_unsafe_fn)]
26
27mod datum_vec;
28mod diff;
29mod relation;
30mod relation_and_scalar;
31mod row;
32mod scalar;
33
34pub mod adt;
35pub mod bytes;
36pub mod catalog_item_id;
37pub mod explain;
38pub mod fixed_length;
39pub mod global_id;
40pub mod namespaces;
41pub mod network_policy_id;
42pub mod optimize;
43pub mod refresh_schedule;
44pub mod role_id;
45pub mod stats;
46pub mod strconv;
47pub mod timestamp;
48pub mod user;
49
50pub use crate::catalog_item_id::CatalogItemId;
51pub use crate::datum_vec::{DatumVec, DatumVecBorrow};
52pub use crate::diff::Diff;
53pub use crate::global_id::GlobalId;
54pub use crate::relation::{
55    ColumnIndex, ColumnName, NotNullViolation, PropRelationDescDiff, ProtoColumnName,
56    ProtoColumnType, ProtoRelationDesc, ProtoRelationType, RelationDesc, RelationDescBuilder,
57    RelationVersion, RelationVersionSelector, ReprColumnType, SqlColumnType, SqlRelationType,
58    UNKNOWN_COLUMN_NAME, VersionedRelationDesc, arb_relation_desc_diff,
59    arb_relation_desc_projection, arb_row_for_relation,
60};
61pub use crate::row::encode::{RowColumnarDecoder, RowColumnarEncoder, preserves_order};
62pub use crate::row::iter::{IntoRowIterator, RowIterator};
63pub use crate::row::{
64    DatumList, DatumMap, ProtoNumeric, ProtoRow, Row, RowArena, RowPacker, RowRef, SharedRow,
65    datum_list_size, datum_size, datums_size, read_datum, row_size,
66};
67pub use crate::scalar::{
68    ArrayRustType, AsColumnType, Datum, DatumType, PropArray, PropDatum, PropDict, PropList,
69    ProtoScalarType, ReprScalarType, ScalarBaseType, SqlScalarType, arb_datum,
70    arb_datum_for_column, arb_datum_for_scalar, arb_range_type,
71};
72pub use crate::timestamp::{Timestamp, TimestampManipulation};