use crate::{
Result,
engine::exec::{Action, Exec, Output},
};
use toasty_core::{
driver::{ExecResponse, Rows},
stmt,
};
#[derive(Debug)]
pub(crate) struct SetVar {
pub value: stmt::Value,
pub output: Output,
}
impl Exec<'_> {
pub(super) fn action_set_var(&mut self, action: &SetVar) -> Result<()> {
self.vars.store(
action.output.var,
action.output.num_uses,
ExecResponse::from_rows(Rows::Value(action.value.clone())),
);
Ok(())
}
}
impl From<SetVar> for Action {
fn from(value: SetVar) -> Self {
Self::SetVar(value)
}
}