2022-04-01 22:28:54 +00:00
|
|
|
use crate::sql::value::Value;
|
|
|
|
|
|
|
|
impl Value {
|
|
|
|
pub fn single(&self) -> &Self {
|
|
|
|
match self {
|
2022-05-04 16:14:40 +00:00
|
|
|
Value::Array(v) => match v.first() {
|
2022-04-01 22:28:54 +00:00
|
|
|
None => &Value::None,
|
|
|
|
Some(v) => v,
|
|
|
|
},
|
|
|
|
v => v,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|