pub enum CastTarget {
Show 22 variants
Int,
BigInt,
Float,
Text,
Bool,
Vector,
Date,
Timestamp,
Interval,
Timestamptz,
Json,
Jsonb,
RegType,
RegClass,
TextArray,
IntArray,
BigIntArray,
TsVector,
TsQuery,
Uuid,
Bytea,
Named(String),
}Variants§
Int
BigInt
Float
Text
Bool
Vector
Date
Timestamp
Interval
v7.9.25 — ::INTERVAL and ::TIMESTAMPTZ. mailrs follow-up
H3a. Engine reuses the existing runtime-interval / timestamp
paths (parse the text input, return the matching Value).
Timestamptz
Json
v7.9.25 — ::JSON and ::JSONB. SPG already has both
types (v7.9.0); the cast just routes Text→Json with the
requested OID for the wire layer.
Jsonb
RegType
v7.9.26 — ::regtype / ::regclass. Parsed for PG dump
compatibility; engine surfaces as Unsupported with a
hint to use SHOW TABLES or spg_table_ddl. mailrs F3b.
RegClass
TextArray
v7.10.11 — ::TEXT[]. Engine decodes the LHS Text into
the PG external array form {a,b,NULL}.
IntArray
v7.11.13 — ::INT[] / ::BIGINT[]. Decodes PG external
{1,2,3} or widens a TextArray whose elements are
integer-shaped.
BigIntArray
TsVector
v7.12.0 — ::tsvector / ::tsquery. Decodes the PG
external form text representation. Used by pg_dump output
and by WHERE col @@ 'term'::tsquery literal patterns.
TsQuery
Uuid
v7.17.0 — ::uuid. Decodes the LHS Text via
spg_storage::parse_uuid_str (accepts canonical hyphenated,
unhyphenated, uppercase, and brace-wrapped forms); malformed
input is a SQL error.
Bytea
v7.18 — ::bytea. Decodes the LHS Text via PG’s hex form
('\xdeadbeef') or escape form ('\x05\x00'); Bytes
inputs pass through unchanged. Closes the mailrs D-pre #3
reverse-acceptance gap — anywhere a PG schema writes
expr::bytea, SPG now matches.
Named(String)
v7.37.5 ship triage — generic cast target for the long tail
of PG type names the parser meets in expr::TYPE shapes that
don’t deserve their own enum variant. The engine routes these
through column_type_to_data_type + the existing typed
coerce_value dispatch, so adding a new PG type to SPG
implicitly adds its cast-target form too — no parser change
per type. The string carries the lowercase PG type ident
(e.g. "point", "int4multirange"); the engine errors with
a clear message when the type isn’t known.
Trait Implementations§
Source§impl Clone for CastTarget
impl Clone for CastTarget
Source§fn clone(&self) -> CastTarget
fn clone(&self) -> CastTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more