Skip to content

Commit b1df053

Browse files
committed
sql_parser: select statement parser refactoring(4)
1 parent 35d2ab0 commit b1df053

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/parser/select/from/function.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/parser/select/select_from.rs src/parser/select/from/mod.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
mod function;
2+
mod subquery;
3+
14
use crate::parser::{ExpressionParser, IdentifierParser, ParsingError};
25
use crate::{
36
FromClause, JoinClause, JoinConstraint, JoinTable, JoinType, Keyword, Parser, TokenType,
47
};
58

6-
pub use super::select_from_subquery::SelectFromSubqueryParser;
9+
pub use subquery::SelectFromSubqueryParser;
710

811
pub trait SelectFromParser {
912
fn parse_from_clause(&mut self) -> Result<Option<FromClause>, ParsingError>;

src/parser/select/select_from_subquery.rs src/parser/select/from/subquery.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
use super::SelectFromParser;
2+
use crate::parser::select::SelectStatementParser;
13
use crate::{
24
parser::{ExpressionParser, IdentifierParser, ParsingError},
35
FromClause, Keyword, Parser, QualifiedTableName, SelectFromFunction, SelectFromSubquery,
46
TokenType,
57
};
68

7-
use super::{SelectFromParser, SelectStatementParser};
8-
99
pub trait SelectFromSubqueryParser {
1010
fn parse_from_clause_subquery(&mut self) -> Result<FromClause, ParsingError>;
1111
}
@@ -75,7 +75,7 @@ impl<'a> SelectFromSubqueryParser for Parser<'a> {
7575

7676
#[cfg(test)]
7777
mod test_select_from_subquery {
78-
use crate::parser::select::select_from::test_utils::*;
78+
use crate::parser::select::from::test_utils::*;
7979
use crate::parser::test_utils::*;
8080
use crate::{Identifier, QualifiedTableName, SelectFromSubquery, Statement};
8181

src/parser/select/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
mod from;
12
mod select_columns;
2-
mod select_from;
3-
mod select_from_subquery;
43
mod values;
54

65
use crate::ast::{
@@ -15,9 +14,9 @@ use super::Parser;
1514
use crate::ast::{Select, SelectStatement};
1615
use crate::parser::errors::ParsingError;
1716

17+
pub use from::*;
1818
pub use select_columns::SelectColumnsParser;
19-
pub use select_from::SelectFromParser;
20-
pub use values::ValuesStatementParser;
19+
use values::ValuesStatementParser;
2120

2221
/// Trait for parsing SELECT statements
2322
/// The SELECT statement documentation can be found here:

0 commit comments

Comments
 (0)