pub enum IrLiteral {
Show 15 variants
Null,
Bool(bool),
Int(i64),
Float(f64),
Str(String),
Uuid([u8; 16]),
Duration {
months: i64,
days: i64,
seconds: i64,
nanos: i64,
},
DateTime(i64),
Date(i64),
LocalDateTime {
days: i64,
nanos: i64,
},
Time(i64),
ZonedTime {
nanos: i64,
offset: i32,
},
ZonedDateTime {
days: i64,
nanos: i64,
offset: i32,
zone: Option<String>,
},
List(Vec<IrLiteral>),
Map(Vec<(String, IrLiteral)>),
}Expand description
A scalar constant value in the Graph IR.
Temporal values are stored as microseconds since the Unix epoch (UTC),
consistent with the Arrow Timestamp(Microsecond, "UTC") convention used
throughout the project.
§Float serialisation
Finite Float values serialise as JSON numbers. Non-finite IEEE-754 values
(NaN, +Infinity, -Infinity) that serde_json cannot represent as JSON
numbers are encoded as a tagged object {"$float": "<tag>"} where <tag> is
"NaN", "+Infinity", or "-Infinity". This preserves full round-trip
fidelity rather than silently collapsing to null.
Variants§
Null
The Cypher null value.
Bool(bool)
A boolean constant.
Int(i64)
A 64-bit integer constant.
Float(f64)
A 64-bit floating-point constant.
Non-finite values (NaN, ±Infinity) are supported and round-trip through JSON via a tagged encoding; see the enum-level docs.
Str(String)
A UTF-8 string constant.
Uuid([u8; 16])
A typed UUID query parameter, stored as its canonical 16-byte identity. This is not Cypher syntax and must not be inferred from strings.
Duration
A Cypher duration as signed months/days/nanos (ADR 0009): months and days
kept distinct from sub-day time. Persisted as a Struct{months,days,nanos}
(Parquet cannot store Arrow Interval). (#920)
Fields
DateTime(i64)
A point-in-time expressed as microseconds since the Unix epoch (UTC).
Date(i64)
A calendar date as i64 days since the Unix epoch — the full openCypher
year range −999,999,999..+999,999,999. Persisted as a self-describing
Struct{epoch_day: Int64} (a bare Int64 is indistinguishable from an
integer property). (#920/#1011)
LocalDateTime
A Cypher localdatetime (ADR 0009): a date (days since the Unix epoch)
plus a time-of-day (nanos since midnight), with no zone. Persisted as a
Struct{date: Int64, time: Time64(ns)}. (#920/#1011)
Fields
Time(i64)
A Cypher localtime (ADR 0009): a time-of-day in nanoseconds since
midnight, no zone. Persisted as a native Arrow Time64(ns) column. (#920)
ZonedTime
A Cypher time (ADR 0009): a time-of-day plus its UTC offset in seconds.
Persisted as a Struct{time: Time64(ns), offset: Int32}. (#920)
ZonedDateTime
A Cypher datetime (ADR 0009): a date+time, its UTC offset in seconds,
and an optional named IANA zone. Persisted as a
Struct{date: Date32, time: Time64(ns), offset: Int32, zone: Utf8}.
Distinct from IrLiteral::DateTime (a bare UTC micros instant). (#920/#1011)
Fields
List(Vec<IrLiteral>)
A homogeneous list of values, persisted as an Arrow List<inner> column
(the inner type is inferred from the elements). Stores e.g. a property
whose value is [date(…), date(…)]. Heterogeneous lists are out of scope
(#1005). (#1006)
Map(Vec<(String, IrLiteral)>)
A query-parameter map value. Map literals in parsed Cypher still lower as
IrExpr::MapLiteral; this variant lets callers bind $param to a map
through execute_with_params and then use Cypher value access on it.