mz_pgrepr/
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//! Representation of and serialization for PostgreSQL datums.
11//!
12//! This crate exports a [`Value`] type that maps directly to a PostgreSQL
13//! datum. These values can be serialized using either the text or binary
14//! encoding format; see the [`mz_pgwire_common::Format`] type for details.
15//!
16//! `Value`s are easily converted to and from [`mz_repr::Datum`]s. See, for
17//! example, the [`values_from_row`] function.
18
19#![warn(clippy::as_conversions)]
20#![warn(missing_docs)]
21
22mod types;
23mod value;
24
25pub mod oid;
26
27pub use types::{
28    ANYCOMPATIBLELIST, ANYCOMPATIBLEMAP, LIST, MAP, Type, TypeConversionError, TypeFromOidError,
29};
30pub use value::interval::Interval;
31pub use value::jsonb::Jsonb;
32pub use value::numeric::Numeric;
33pub use value::record::Record;
34pub use value::unsigned::{UInt2, UInt4, UInt8};
35pub use value::{Value, values_from_row};