Enable fetching WHERE clause from statement in iterator
This commit is contained in:
parent
24752a75d9
commit
5b1d727c25
1 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
use crate::sql::cond::Cond;
|
||||||
use crate::sql::group::Groups;
|
use crate::sql::group::Groups;
|
||||||
use crate::sql::limit::Limit;
|
use crate::sql::limit::Limit;
|
||||||
use crate::sql::order::Orders;
|
use crate::sql::order::Orders;
|
||||||
|
@ -81,6 +82,15 @@ impl fmt::Display for Statement {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Statement {
|
impl Statement {
|
||||||
|
// Returns any SPLIT clause if specified
|
||||||
|
pub fn conds(self: &Statement) -> Option<&Cond> {
|
||||||
|
match self {
|
||||||
|
Statement::Select(v) => v.cond.as_ref(),
|
||||||
|
Statement::Update(v) => v.cond.as_ref(),
|
||||||
|
Statement::Delete(v) => v.cond.as_ref(),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
// Returns any SPLIT clause if specified
|
// Returns any SPLIT clause if specified
|
||||||
pub fn split(self: &Statement) -> Option<&Splits> {
|
pub fn split(self: &Statement) -> Option<&Splits> {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in a new issue