pub enum ColumnTypeName {
}Expand description
SQL-level type names. The mapping to the storage runtime’s DataType
happens in spg-engine — keeping spg-sql free of storage deps.
Variants§
SmallInt
Int
BigInt
Float
Text
Varchar(u32)
VARCHAR(N) — TEXT capped at N Unicode characters.
Char(u32)
CHAR(N) — TEXT right-padded with spaces to exactly N characters.
Bool
Vector
pgvector fixed-dimension VECTOR(N). v6.0.1 added the
USING <encoding> clause; omitting it surfaces as
encoding = VecEncoding::F32 (the pre-v6 default).
Numeric(u8, u8)
NUMERIC / NUMERIC(p) / NUMERIC(p, s) — exact decimal.
Bare NUMERIC and NUMERIC(p) both surface with scale=0.
Date
DATE — calendar day, no time-of-day component.
Timestamp
TIMESTAMP / MySQL DATETIME — instant with microsecond
precision.
Timestamptz
v7.9.2 TIMESTAMPTZ / TIMESTAMP WITH TIME ZONE. SPG
stores all timestamps as UTC microseconds-since-epoch and
does not carry per-row offset (PG’s internal representation
is the same — TZ is a display convention). The distinction
from TIMESTAMP exists for the PG-wire layer to advertise
OID 1184 so sqlx-style clients decode into
chrono::DateTime<Utc> instead of NaiveDateTime.
Json
v4.9 JSON — text-backed JSON document. No parse-time
validation; the engine round-trips the literal verbatim.
PG OID 114 on the wire.
Jsonb
v7.9.0 JSONB — same storage shape as Json, advertised as
PG OID 3802 on the wire so sqlx-style binary-typed clients
decode without a custom type registration.
Bytes
v7.10.4 BYTES / BYTEA — raw binary blob. PG wire OID 17.
Literal forms (decoded by the engine at coercion time):
- PG hex form:
'\xDEADBEEF' - Escape form:
'foo\\000bar'(backslash octal triples)
TextArray
v7.10.10 TEXT[] — single-dimension TEXT array. PG wire
OID 1009. Literal forms accepted by the parser:
ARRAY['a', 'b', NULL]'{a,b,NULL}'::TEXT[](engine decodes the external form at coerce time)
IntArray
v7.11.13 INT[] — single-dimension i32 array. PG wire OID
1007. Same literal forms as TEXT[] (substituting integer
elements).
BigIntArray
v7.11.13 BIGINT[] — single-dimension i64 array. PG wire
OID 1016.
Trait Implementations§
Source§impl Clone for ColumnTypeName
impl Clone for ColumnTypeName
Source§fn clone(&self) -> ColumnTypeName
fn clone(&self) -> ColumnTypeName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ColumnTypeName
Source§impl Debug for ColumnTypeName
impl Debug for ColumnTypeName
Source§impl Display for ColumnTypeName
impl Display for ColumnTypeName
impl Eq for ColumnTypeName
Source§impl PartialEq for ColumnTypeName
impl PartialEq for ColumnTypeName
Source§fn eq(&self, other: &ColumnTypeName) -> bool
fn eq(&self, other: &ColumnTypeName) -> bool
self and other values to be equal, and is used by ==.