2022-09-19 02:56:59 +00:00
|
|
|
use crate::err::Error;
|
|
|
|
use crate::sql::value::Value;
|
|
|
|
|
2022-09-21 00:57:33 +00:00
|
|
|
pub fn id((arg,): (Value,)) -> Result<Value, Error> {
|
|
|
|
Ok(match arg {
|
2022-09-19 02:56:59 +00:00
|
|
|
Value::Thing(v) => v.id.into(),
|
|
|
|
_ => Value::None,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2022-09-21 00:57:33 +00:00
|
|
|
pub fn tb((arg,): (Value,)) -> Result<Value, Error> {
|
|
|
|
Ok(match arg {
|
2022-09-19 02:56:59 +00:00
|
|
|
Value::Thing(v) => v.tb.into(),
|
|
|
|
_ => Value::None,
|
|
|
|
})
|
|
|
|
}
|