Enum light_snowflake_connector::Cell
source · pub enum Cell {
Null,
Int(i128),
Float(f64),
Varchar(String),
Binary(Vec<u8>),
Boolean(bool),
Date(NaiveDate),
Time(NaiveTime),
TimestampLtz(DateTime<Local>),
TimestampNtz(NaiveDateTime),
}
Expand description
Cell types, used for receiving data from Snowflake.
Snowflake returns these as a list of Strings; these are the result of parsing those strings, and as such there are some caveats to be aware of.
Variants§
Null
A NULL
value. Any column could be null unless it is declared as NOT NULL
,
but the driver is not aware of this information from the metadata.
Int(i128)
A 128-bit signed integer, 38 digits of precision. Any NUMBER cell that can be represented as an integer will be, but this means that NUMBER columns can contain mixed types: Int and Float.
e.g. ["1", "1.0", "1.1"]
will be parsed as [Int(1), Int(1), Float(1.1)]
Float(f64)
A 64-bit floating point number, 15 digits of precision. Any NUMBER cell that cannot be represented as an integer will be parsed as a float. Additionally, all REAL columns will be parsed as floats. This is lossy, but intended for convenience.
Varchar(String)
A variable length string. It must be valid UTF-8.
Binary(Vec<u8>)
A variable length binary string. (This is serialized over the wire as a hex string, so these are not bandwidth efficient.)
Boolean(bool)
A boolean value.
Date(NaiveDate)
A date without a time zone.
Time(NaiveTime)
A time without a time zone.
TimestampLtz(DateTime<Local>)
A timestamp with the local time zone. (This is not extensively tested)
TimestampNtz(NaiveDateTime)
A timestamp without a time zone. Presumably this is UTC, but it is not specified.