2022-02-06 01:14:56 +00:00
|
|
|
use crate::dbs::Options;
|
|
|
|
use crate::dbs::Runtime;
|
2022-02-15 01:00:30 +00:00
|
|
|
use crate::dbs::Transaction;
|
2022-02-06 01:14:56 +00:00
|
|
|
use crate::err::Error;
|
|
|
|
use crate::sql::part::Part;
|
|
|
|
use crate::sql::thing::Thing;
|
|
|
|
use crate::sql::value::Value;
|
|
|
|
use once_cell::sync::Lazy;
|
|
|
|
|
2022-02-22 19:05:58 +00:00
|
|
|
static RID: Lazy<[Part; 1]> = Lazy::new(|| [Part::from("id")]);
|
2022-02-06 01:14:56 +00:00
|
|
|
|
|
|
|
impl Value {
|
|
|
|
pub async fn def(
|
|
|
|
&mut self,
|
|
|
|
ctx: &Runtime,
|
2022-02-06 21:06:52 +00:00
|
|
|
opt: &Options,
|
2022-02-15 03:33:16 +00:00
|
|
|
txn: &Transaction,
|
2022-04-01 10:17:19 +00:00
|
|
|
val: &Thing,
|
2022-02-06 01:14:56 +00:00
|
|
|
) -> Result<(), Error> {
|
2022-04-01 10:17:19 +00:00
|
|
|
self.set(ctx, opt, txn, RID.as_ref(), val.clone().into()).await
|
2022-02-06 01:14:56 +00:00
|
|
|
}
|
|
|
|
}
|