Skip to main content

ColumnTypeName

Enum ColumnTypeName 

Source
pub enum ColumnTypeName {
Show 19 variants SmallInt, Int, BigInt, Float, Text, Varchar(u32), Char(u32), Bool, Vector { dim: u32, encoding: VecEncoding, }, Numeric(u8, u8), Date, Timestamp, Timestamptz, Json, Jsonb, Bytes, TextArray, IntArray, BigIntArray,
}
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).

Fields

§dim: u32
§encoding: VecEncoding
§

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

Source§

fn clone(&self) -> ColumnTypeName

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ColumnTypeName

Source§

impl Debug for ColumnTypeName

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ColumnTypeName

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ColumnTypeName

Source§

impl PartialEq for ColumnTypeName

Source§

fn eq(&self, other: &ColumnTypeName) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ColumnTypeName

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.