Crate mz_repr

source ·
Expand description

Fundamental data representation.

This module contains the types for representing data in Materialize that all layers of the stack can understand. Think of it as the lingua franca: individual layers may use different representations internally, but they all agree to use this representation at their boundaries.

  • The core value type is the Datum enum, which represents a literal value.
  • Row extends a Datum horizontally, and has features for efficiently doing so.
  • RelationDesc describes what it takes to extend a Row vertically, and corresponds most closely to what is returned from querying our dataflows


pub use crate::global_id::GlobalId;


Abstract data types.
Custom proptest::strategy::Strategy implementations and Protobuf types for the chrono fields used in the codebase.
datum_vec 🔒
A re-useable vector of Datum with varying lifetimes.
diff 🔒
A set of traits for modeling things that can be explained by a SQL EXPLAIN statement.
relation 🔒
row 🔒
scalar 🔒
Routines for converting datum values to and from their string representation.
timestamp 🔒
Custom Protobuf types for the url crate.


The name of a column in a RelationDesc.
The type of a Datum.
A sequence of Datums
A mapping from string keys to Datums
A re-useable vector of Datum with no particular lifetime.
A borrowed allocation of Datum with a specific lifetime.
Expression violated not-null constraint on named column
A description of the shape of a relation.
The type of a relation.
A packed representation for Datums.
RowArena is used to hold on to temporary Rows for functions like eval that need to create complex Datums but don’t have a Row to put them in yet.
Packs datums into a Row.
A wrapper around a byte slice that guarantees the data are row-formatted.
System-wide timestamp type.


A single value.
A mirror type for Datum that can be proptest-generated.
The type of a Datum.


Types that implement this trait can be stored in an SQL column with the specified ColumnType
A bridge between native Rust types and SQL runtime types represented in Datums


Generate an arbitrary PropDatum.
Number of bytes required by a list of datums. This computes the size that would be required if the given datums were packed into a list.
Number of bytes required by the datum.
Number of bytes required by a sequence of datums.
Return the number of bytes these Datums would use if packed as a Row.

Type Definitions

System-wide record count difference type.