diff --git a/src/dbs/executor.rs b/src/dbs/executor.rs index c16388be..fbb7d826 100644 --- a/src/dbs/executor.rs +++ b/src/dbs/executor.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs::response::{Response, Responses}; use crate::dbs::Process; +use crate::dbs::Runtime; use crate::err::Error; use crate::sql::query::Query; use std::time::Instant; @@ -21,7 +21,7 @@ impl Executor { } } - pub fn execute(&self, ctx: &Parent, qry: Query) -> Result { + pub fn execute(&self, ctx: &Runtime, qry: Query) -> Result { let mut r: Vec = vec![]; for stm in qry.statements().iter() { diff --git a/src/dbs/iterator.rs b/src/dbs/iterator.rs index ccd1cb90..ef634e85 100644 --- a/src/dbs/iterator.rs +++ b/src/dbs/iterator.rs @@ -1,5 +1,5 @@ -use crate::ctx::Parent; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::err::Error; use crate::sql::literal::Literal; @@ -9,13 +9,13 @@ impl Iterator { pub fn new() -> Iterator { Iterator {} } - pub fn process_query(&self, ctx: &Parent, exe: &Executor) {} - pub fn process_table(&self, ctx: &Parent, exe: &Executor) {} - pub fn process_thing(&self, ctx: &Parent, exe: &Executor) {} - pub fn process_model(&self, ctx: &Parent, exe: &Executor) {} - pub fn process_array(&self, ctx: &Parent, exe: &Executor) {} - pub fn process_object(&self, ctx: &Parent, exe: &Executor) {} - pub fn output(&self, ctx: &Parent, exe: &Executor) -> Result { + pub fn process_query(&self, ctx: &Runtime, exe: &Executor) {} + pub fn process_table(&self, ctx: &Runtime, exe: &Executor) {} + pub fn process_thing(&self, ctx: &Runtime, exe: &Executor) {} + pub fn process_model(&self, ctx: &Runtime, exe: &Executor) {} + pub fn process_array(&self, ctx: &Runtime, exe: &Executor) {} + pub fn process_object(&self, ctx: &Runtime, exe: &Executor) {} + pub fn output(&self, ctx: &Runtime, exe: &Executor) -> Result { Ok(Literal::Null) } } diff --git a/src/dbs/mod.rs b/src/dbs/mod.rs index f3b10ea3..175afb5b 100644 --- a/src/dbs/mod.rs +++ b/src/dbs/mod.rs @@ -3,8 +3,10 @@ mod executor; mod iterator; mod process; mod response; +mod runtime; pub use self::dbs::*; pub use self::executor::*; pub use self::iterator::*; pub use self::process::*; +pub use self::runtime::*; diff --git a/src/dbs/process.rs b/src/dbs/process.rs index ac628306..0f93cc88 100644 --- a/src/dbs/process.rs +++ b/src/dbs/process.rs @@ -1,5 +1,5 @@ -use crate::ctx::Parent; use crate::dbs::executor::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::literal::Literal; @@ -7,7 +7,7 @@ use crate::sql::literal::Literal; pub trait Process { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result; diff --git a/src/dbs/runtime.rs b/src/dbs/runtime.rs new file mode 100644 index 00000000..5e2248d1 --- /dev/null +++ b/src/dbs/runtime.rs @@ -0,0 +1,25 @@ +/* + * A Runtime is passed around when processing a set of query + * statements. The Runtime contains any saved parameters and + * variables set in the SQL, or any pre-defined paramaters which + * are determined by the authentication / session / environment. + * Embedded queries, and subqueries will create their own Runtime + * based off of the parent Runtime, and set their own variables + * accordingly. Predetermined variables include: + * + * $ENV = "surrealdb.com"; + * + * $auth.AL = "KV" / "NS" / "DB" / "SC"; + * $auth.NS = ""; + * $auth.DB = ""; + * + * $session.id = ""; + * $session.ip = ""; + * $session.origin = "app.surrealdb.com"; + * + */ + +use crate::ctx::Context; +use std::sync::Arc; + +pub type Runtime = Arc; diff --git a/src/fnc/cast.rs b/src/fnc/cast.rs index 10aea585..3ffe7944 100644 --- a/src/fnc/cast.rs +++ b/src/fnc/cast.rs @@ -1,8 +1,8 @@ -use crate::ctx::Context; +use crate::dbs::Runtime; use crate::err::Error; use crate::sql::literal::Literal; -pub fn run(ctx: &Context, name: &String, val: Literal) -> Result { +pub fn run(ctx: &Runtime, name: &String, val: Literal) -> Result { match name.as_str() { "bool" => bool(ctx, val), "int" => int(ctx, val), @@ -16,33 +16,33 @@ pub fn run(ctx: &Context, name: &String, val: Literal) -> Result } } -pub fn bool(ctx: &Context, val: Literal) -> Result { +pub fn bool(ctx: &Runtime, val: Literal) -> Result { match val.as_bool() { true => Ok(Literal::True), false => Ok(Literal::False), } } -pub fn int(ctx: &Context, val: Literal) -> Result { +pub fn int(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Int(val.as_int())) } -pub fn float(ctx: &Context, val: Literal) -> Result { +pub fn float(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Float(val.as_float())) } -pub fn string(ctx: &Context, val: Literal) -> Result { +pub fn string(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Strand(val.as_strand())) } -pub fn number(ctx: &Context, val: Literal) -> Result { +pub fn number(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Number(val.as_number())) } -pub fn datetime(ctx: &Context, val: Literal) -> Result { +pub fn datetime(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Datetime(val.as_datetime())) } -pub fn duration(ctx: &Context, val: Literal) -> Result { +pub fn duration(ctx: &Runtime, val: Literal) -> Result { Ok(Literal::Duration(val.as_duration())) } diff --git a/src/fnc/future.rs b/src/fnc/future.rs index 1e6f5067..6a8c8f7c 100644 --- a/src/fnc/future.rs +++ b/src/fnc/future.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; +use crate::dbs::Runtime; use crate::err::Error; use crate::sql::literal::Literal; -pub fn run(ctx: &Parent, args: Literal) -> Result { +pub fn run(ctx: &Runtime, args: Literal) -> Result { todo!() } diff --git a/src/fnc/mod.rs b/src/fnc/mod.rs index 1ebd85d6..01007797 100644 --- a/src/fnc/mod.rs +++ b/src/fnc/mod.rs @@ -1,4 +1,4 @@ -use crate::ctx::Parent; +use crate::dbs::Runtime; use crate::err::Error; use crate::sql::literal::Literal; @@ -6,6 +6,6 @@ pub mod cast; pub mod future; pub mod operate; -pub fn run(ctx: &Parent, name: &String, args: Vec) -> Result { +pub fn run(ctx: &Runtime, name: &String, args: Vec) -> Result { todo!() } diff --git a/src/sql/array.rs b/src/sql/array.rs index 28ba5e79..b704a9d9 100644 --- a/src/sql/array.rs +++ b/src/sql/array.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::mightbespace; @@ -36,7 +36,7 @@ impl fmt::Display for Array { impl dbs::Process for Array { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/expression.rs b/src/sql/expression.rs index 78acedf3..881d34be 100644 --- a/src/sql/expression.rs +++ b/src/sql/expression.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::fnc; @@ -49,7 +49,7 @@ impl fmt::Display for Expression { impl dbs::Process for Expression { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/function.rs b/src/sql/function.rs index 93470093..594d337c 100644 --- a/src/sql/function.rs +++ b/src/sql/function.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::fnc; @@ -48,7 +48,7 @@ impl fmt::Display for Function { impl dbs::Process for Function { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/idiom.rs b/src/sql/idiom.rs index afa5d660..8f0e53eb 100644 --- a/src/sql/idiom.rs +++ b/src/sql/idiom.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::common::commas; @@ -76,7 +76,7 @@ impl fmt::Display for Idiom { impl dbs::Process for Idiom { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/literal.rs b/src/sql/literal.rs index 753bbea0..c3f5b79a 100644 --- a/src/sql/literal.rs +++ b/src/sql/literal.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::fnc; @@ -349,7 +349,7 @@ impl fmt::Display for Literal { impl dbs::Process for Literal { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/object.rs b/src/sql/object.rs index 8e294065..9ad0ecdb 100644 --- a/src/sql/object.rs +++ b/src/sql/object.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::mightbespace; @@ -45,7 +45,7 @@ impl fmt::Display for Object { impl dbs::Process for Object { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/param.rs b/src/sql/param.rs index 931d58b0..901afa68 100644 --- a/src/sql/param.rs +++ b/src/sql/param.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::common::val_char; @@ -43,7 +43,7 @@ impl fmt::Display for Param { impl dbs::Process for Param { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statement.rs b/src/sql/statement.rs index 70141fb5..a33d346c 100644 --- a/src/sql/statement.rs +++ b/src/sql/statement.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::{comment, mightbespace}; @@ -110,7 +110,7 @@ impl fmt::Display for Statement { impl dbs::Process for Statement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/create.rs b/src/sql/statements/create.rs index 29da5bea..a132f385 100644 --- a/src/sql/statements/create.rs +++ b/src/sql/statements/create.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -46,7 +46,7 @@ impl fmt::Display for CreateStatement { impl dbs::Process for CreateStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/define.rs b/src/sql/statements/define.rs index fba36294..5ac0a512 100644 --- a/src/sql/statements/define.rs +++ b/src/sql/statements/define.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::algorithm::{algorithm, Algorithm}; @@ -56,7 +56,7 @@ impl fmt::Display for DefineStatement { impl dbs::Process for DefineStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/delete.rs b/src/sql/statements/delete.rs index fd08cf95..b1c7c388 100644 --- a/src/sql/statements/delete.rs +++ b/src/sql/statements/delete.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -47,7 +47,7 @@ impl fmt::Display for DeleteStatement { impl dbs::Process for DeleteStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/ifelse.rs b/src/sql/statements/ifelse.rs index c36dabaa..d0eeba25 100644 --- a/src/sql/statements/ifelse.rs +++ b/src/sql/statements/ifelse.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -42,7 +42,7 @@ impl fmt::Display for IfelseStatement { impl dbs::Process for IfelseStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/info.rs b/src/sql/statements/info.rs index 12740708..acd47126 100644 --- a/src/sql/statements/info.rs +++ b/src/sql/statements/info.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -34,7 +34,7 @@ impl fmt::Display for InfoStatement { impl dbs::Process for InfoStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/insert.rs b/src/sql/statements/insert.rs index 76f38c68..ce3b3cf4 100644 --- a/src/sql/statements/insert.rs +++ b/src/sql/statements/insert.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -44,7 +44,7 @@ impl fmt::Display for InsertStatement { impl dbs::Process for InsertStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/kill.rs b/src/sql/statements/kill.rs index 387ed8b9..6e78183a 100644 --- a/src/sql/statements/kill.rs +++ b/src/sql/statements/kill.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -25,7 +25,7 @@ impl fmt::Display for KillStatement { impl dbs::Process for KillStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/live.rs b/src/sql/statements/live.rs index 95d9d2cf..bee189a1 100644 --- a/src/sql/statements/live.rs +++ b/src/sql/statements/live.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -42,7 +42,7 @@ impl fmt::Display for LiveStatement { impl dbs::Process for LiveStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/option.rs b/src/sql/statements/option.rs index e9852293..7b5f2121 100644 --- a/src/sql/statements/option.rs +++ b/src/sql/statements/option.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::mightbespace; @@ -35,7 +35,7 @@ impl fmt::Display for OptionStatement { impl dbs::Process for OptionStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/output.rs b/src/sql/statements/output.rs index cd07e5c7..4c9adc87 100644 --- a/src/sql/statements/output.rs +++ b/src/sql/statements/output.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -25,7 +25,7 @@ impl fmt::Display for OutputStatement { impl dbs::Process for OutputStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/relate.rs b/src/sql/statements/relate.rs index e8820ae2..29822b1b 100644 --- a/src/sql/statements/relate.rs +++ b/src/sql/statements/relate.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::mightbespace; @@ -57,7 +57,7 @@ impl fmt::Display for RelateStatement { impl dbs::Process for RelateStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/remove.rs b/src/sql/statements/remove.rs index f44de79d..4edf4779 100644 --- a/src/sql/statements/remove.rs +++ b/src/sql/statements/remove.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::base::{base, Base}; @@ -46,7 +46,7 @@ impl fmt::Display for RemoveStatement { impl dbs::Process for RemoveStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/select.rs b/src/sql/statements/select.rs index c46feb03..de8e7e9b 100644 --- a/src/sql/statements/select.rs +++ b/src/sql/statements/select.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -84,7 +84,7 @@ impl fmt::Display for SelectStatement { impl dbs::Process for SelectStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/set.rs b/src/sql/statements/set.rs index ceccc192..e41ae521 100644 --- a/src/sql/statements/set.rs +++ b/src/sql/statements/set.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::mightbespace; @@ -29,7 +29,7 @@ impl fmt::Display for SetStatement { impl dbs::Process for SetStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/update.rs b/src/sql/statements/update.rs index 8d2edfa2..ed42abe0 100644 --- a/src/sql/statements/update.rs +++ b/src/sql/statements/update.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -52,7 +52,7 @@ impl fmt::Display for UpdateStatement { impl dbs::Process for UpdateStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/upsert.rs b/src/sql/statements/upsert.rs index cfbc40dd..bb02554d 100644 --- a/src/sql/statements/upsert.rs +++ b/src/sql/statements/upsert.rs @@ -1,7 +1,7 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; use crate::dbs::Iterator; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -44,7 +44,7 @@ impl fmt::Display for UpsertStatement { impl dbs::Process for UpsertStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/statements/yuse.rs b/src/sql/statements/yuse.rs index a595a416..f4be4d1f 100644 --- a/src/sql/statements/yuse.rs +++ b/src/sql/statements/yuse.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::comment::shouldbespace; @@ -36,7 +36,7 @@ impl fmt::Display for UseStatement { impl dbs::Process for UseStatement { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/subquery.rs b/src/sql/subquery.rs index 60f155a4..186fc94d 100644 --- a/src/sql/subquery.rs +++ b/src/sql/subquery.rs @@ -1,7 +1,7 @@ use crate::ctx::Context; -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::expression::{expression, Expression}; @@ -61,7 +61,7 @@ impl fmt::Display for Subquery { impl dbs::Process for Subquery { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result { diff --git a/src/sql/value.rs b/src/sql/value.rs index 9a24b82d..40019f13 100644 --- a/src/sql/value.rs +++ b/src/sql/value.rs @@ -1,6 +1,6 @@ -use crate::ctx::Parent; use crate::dbs; use crate::dbs::Executor; +use crate::dbs::Runtime; use crate::doc::Document; use crate::err::Error; use crate::sql::expression::Expression; @@ -44,7 +44,7 @@ impl fmt::Display for Value { impl dbs::Process for Value { fn process( &self, - ctx: &Parent, + ctx: &Runtime, exe: &Executor, doc: Option<&Document>, ) -> Result {