pub struct SourceColumn {
pub name: String,
pub native_type: String,
pub nullable: bool,
pub precision: Option<u8>,
pub scale: Option<i8>,
pub length: Option<u64>,
pub datetime_precision: Option<u8>,
}Expand description
Metadata captured from the source database for a single column,
before it is mapped to a RivetType.
Names follow the roadmap struct (§6 SourceColumn) one-for-one so the document and the code stay in lockstep. Optional fields are populated only when the source driver actually provides them — Rivet must never invent a precision/scale to “fill in” a missing one (that is exactly the silent-degradation pattern the roadmap forbids).
Fields§
§name: StringColumn name as reported by the source database.
native_type: StringNative database type identifier — vendor-specific string used for
reports and policy decisions (e.g. "numeric", "timestamptz",
"jsonb"). Always present.
nullable: boolTrue when the source schema declares the column nullable.
Current limitation (see ADR-0016): every driver passes true
here unconditionally — Rivet does not query
information_schema.columns.is_nullable (MySQL) /
pg_attribute.attnotnull (PostgreSQL), so source NOT NULL
constraints are not propagated to the output Parquet schema.
Downstream catalog tools therefore see every column as nullable
regardless of source declaration. Conservative for write paths
(any value passes), lossy for read paths (cannot distinguish
“schema-mandated NOT NULL” from “allows NULL but happened to have
no NULLs in this run”). Tracked for v0.8 Phase A type-report
extension (per ADR-0014).
precision: Option<u8>Decimal precision — number of total significant digits. Only present
for fixed-precision numeric types where the source actually declared
a precision (e.g. numeric(18,2) → Some(18); numeric → None).
scale: Option<i8>Decimal scale — number of digits to the right of the decimal point.
Signed because PostgreSQL allows negative scale for numeric (e.g.
numeric(5,-2) rounds to hundreds).
length: Option<u64>Length for variable-length character/binary types when the source
declares one (e.g. varchar(255) → Some(255)).
datetime_precision: Option<u8>Fractional-second precision for temporal types when declared
(e.g. timestamp(6) → Some(6)).
Implementations§
Trait Implementations§
Source§impl Clone for SourceColumn
impl Clone for SourceColumn
Source§fn clone(&self) -> SourceColumn
fn clone(&self) -> SourceColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SourceColumn
impl Debug for SourceColumn
impl Eq for SourceColumn
Source§impl PartialEq for SourceColumn
impl PartialEq for SourceColumn
Source§fn eq(&self, other: &SourceColumn) -> bool
fn eq(&self, other: &SourceColumn) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SourceColumn
impl Serialize for SourceColumn
impl StructuralPartialEq for SourceColumn
Auto Trait Implementations§
impl Freeze for SourceColumn
impl RefUnwindSafe for SourceColumn
impl Send for SourceColumn
impl Sync for SourceColumn
impl Unpin for SourceColumn
impl UnsafeUnpin for SourceColumn
impl UnwindSafe for SourceColumn
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.