|
17 | 17 |
|
18 | 18 | //! Recursive visitors for ast Nodes. See [`Visitor`] for more details. |
19 | 19 |
|
20 | | -use crate::ast::{Expr, ObjectName, Query, Statement, TableFactor, Value}; |
| 20 | +use crate::ast::{Expr, ObjectName, Query, Statement, TableFactor, Value, Select}; |
21 | 21 | use core::ops::ControlFlow; |
22 | 22 |
|
23 | 23 | /// A type that can be visited by a [`Visitor`]. See [`Visitor`] for |
@@ -207,6 +207,16 @@ pub trait Visitor { |
207 | 207 | ControlFlow::Continue(()) |
208 | 208 | } |
209 | 209 |
|
| 210 | + /// Invoked for any [Select] that appear in the AST before visiting children |
| 211 | + fn pre_visit_select(&mut self, _select: &Select) -> ControlFlow<Self::Break> { |
| 212 | + ControlFlow::Continue(()) |
| 213 | + } |
| 214 | + |
| 215 | + /// Invoked for any [Select] that appear in the AST after visiting children |
| 216 | + fn post_visit_select(&mut self, _select: &Select) -> ControlFlow<Self::Break> { |
| 217 | + ControlFlow::Continue(()) |
| 218 | + } |
| 219 | + |
210 | 220 | /// Invoked for any relations (e.g. tables) that appear in the AST before visiting children |
211 | 221 | fn pre_visit_relation(&mut self, _relation: &ObjectName) -> ControlFlow<Self::Break> { |
212 | 222 | ControlFlow::Continue(()) |
@@ -319,6 +329,16 @@ pub trait VisitorMut { |
319 | 329 | ControlFlow::Continue(()) |
320 | 330 | } |
321 | 331 |
|
| 332 | + /// Invoked for any [Select] that appear in the AST before visiting children |
| 333 | + fn pre_visit_select(&mut self, _select: &Select) -> ControlFlow<Self::Break> { |
| 334 | + ControlFlow::Continue(()) |
| 335 | + } |
| 336 | + |
| 337 | + /// Invoked for any [Select] that appear in the AST after visiting children |
| 338 | + fn post_visit_select(&mut self, _select: &Select) -> ControlFlow<Self::Break> { |
| 339 | + ControlFlow::Continue(()) |
| 340 | + } |
| 341 | + |
322 | 342 | /// Invoked for any relations (e.g. tables) that appear in the AST before visiting children |
323 | 343 | fn pre_visit_relation(&mut self, _relation: &mut ObjectName) -> ControlFlow<Self::Break> { |
324 | 344 | ControlFlow::Continue(()) |
|
0 commit comments