1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/// The encoding to use when decoding/encoding Ion to/from PartiQL [`partiql_value::Value`]
#[derive(Copy, Clone, Eq, PartialEq)]
pub enum Encoding {
    /// 'Unlifted'/'Unlowered' Ion to/from PartiQL [`partiql_value::Value`]. [`partiql_value::Value`]s that do not have a direct
    /// Ion analog will result in an error (e.g. PartiQL [`partiql_value::Value`] has a 'bag' type, but Ion does not,
    /// so attempting to encode a 'bag' results in an error).
    Ion,
    /// PartiQL encoded into Ion as supported by `partiql-tests` and by other implementations.
    /// (e.g., a PartiQL bag is encoded as an Ion list annotated with "$bag").
    PartiqlEncodedAsIon,
}

pub(crate) const BAG_ANNOT: &str = "$bag";
pub(crate) const TIME_ANNOT: &str = "$time";
pub(crate) const DATE_ANNOT: &str = "$date";
pub(crate) const MISSING_ANNOT: &str = "$missing";

pub(crate) const TIME_PART_HOUR_KEY: &str = "hour";
pub(crate) const TIME_PART_MINUTE_KEY: &str = "minute";
pub(crate) const TIME_PART_SECOND_KEY: &str = "second";
pub(crate) const TIME_PART_TZ_HOUR_KEY: &str = "timezone_hour";
pub(crate) const TIME_PART_TZ_MINUTE_KEY: &str = "timezone_minute";

pub(crate) const RE_SET_TIME_PARTS: [&str; 5] = [
    "^hour$",
    "^minute$",
    "^second$",
    "^timezone_hour$",
    "^timezone_minute$",
];
pub(crate) const TIME_PARTS_HOUR: usize = 0;
pub(crate) const TIME_PARTS_MINUTE: usize = 1;
pub(crate) const TIME_PARTS_SECOND: usize = 2;
pub(crate) const TIME_PARTS_TZ_HOUR: usize = 3;
pub(crate) const TIME_PARTS_TZ_MINUTE: usize = 4;