Add additional database type

This commit is contained in:
Tobie Morgan Hitchcock 2023-03-31 23:38:29 +01:00
parent 45094c76ce
commit 8a726b794b
2 changed files with 7 additions and 0 deletions

View file

@ -16,6 +16,7 @@ pub enum Kind {
Any,
Array,
Bool,
Bytes,
Datetime,
Decimal,
Duration,
@ -40,6 +41,7 @@ impl Display for Kind {
Kind::Any => f.write_str("any"),
Kind::Array => f.write_str("array"),
Kind::Bool => f.write_str("bool"),
Kind::Bytes => f.write_str("bytes"),
Kind::Datetime => f.write_str("datetime"),
Kind::Decimal => f.write_str("decimal"),
Kind::Duration => f.write_str("duration"),
@ -59,6 +61,7 @@ pub fn kind(i: &str) -> IResult<&str, Kind> {
map(tag("any"), |_| Kind::Any),
map(tag("array"), |_| Kind::Array),
map(tag("bool"), |_| Kind::Bool),
map(tag("bytes"), |_| Kind::Bytes),
map(tag("datetime"), |_| Kind::Datetime),
map(tag("decimal"), |_| Kind::Decimal),
map(tag("duration"), |_| Kind::Duration),

View file

@ -1075,6 +1075,10 @@ impl Value {
Kind::String => self.make_strand(),
Kind::Datetime => self.make_datetime(),
Kind::Duration => self.make_duration(),
Kind::Bytes => match self {
Value::Bytes(_) => self,
_ => Value::None,
},
Kind::Array => match self {
Value::Array(_) => self,
_ => Value::None,