surrealpatch/lib/src/fnc/meta.rs

17 lines
315 B
Rust
Raw Normal View History

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 {
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 {
Value::Thing(v) => v.tb.into(),
_ => Value::None,
})
}