Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
andicuko committed Jun 11, 2024
1 parent c396726 commit 73564a4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
## [0.9.19] - 2024-05-23
### Fixed
- Fix parsing of CTEs with column alias
### Added
- parsing of CTEs with column alias

## [0.9.18] - 2024-05-23
### Added
Expand Down
10 changes: 5 additions & 5 deletions src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ mod tests {
println!("schema {} = {}", tab, tab.schema());
}
for query in [
// "SELECT 1+count(y) as a, sum(1+x) as b FROM table_2",
// "
// WITH t1 AS (SELECT a,d FROM table_1 WHERE a>4),
// t2 AS (SELECT * FROM table_2)
// SELECT max(a), sum(d) FROM t1 INNER JOIN t2 ON t1.d = t2.x CROSS JOIN table_2 GROUP BY t2.y, t1.a",
"SELECT 1+count(y) as a, sum(1+x) as b FROM table_2",
"
WITH t1 AS (SELECT a,d FROM table_1 WHERE a>4),
t2 AS (SELECT * FROM table_2)
SELECT max(a), sum(d) FROM t1 INNER JOIN t2 ON t1.d = t2.x CROSS JOIN table_2 GROUP BY t2.y, t1.a",
"
WITH t1 AS (SELECT a, d FROM table_1),
t2 AS (SELECT * FROM table_2)
Expand Down
16 changes: 8 additions & 8 deletions src/sql/relation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ impl From<ast::SetQuantifier> for SetQuantifier {
// This is RelationWithColumns from_xxx method

/// A struct to hold Relations with column mapping in the FROM
#[derive(Clone)]
struct RelationWithColumns(Arc<Relation>, Hierarchy<Identifier>);

impl RelationWithColumns {
Expand Down Expand Up @@ -876,13 +875,14 @@ impl<'a> TryFrom<QueryWithRelations<'a>> for Relation {
let query_names = query.accept(IntoQueryNamesVisitor);
let query_aliases = query.accept(IntoQueryAliasesVisitor);
// Visit for conversion
let visitor = TryIntoRelationVisitor::new(
relations,
query_names,
query_aliases,
PostgreSqlTranslator,
);
query.accept(visitor).map(|r| r.as_ref().clone())
query
.accept(TryIntoRelationVisitor::new(
relations,
query_names,
query_aliases,
PostgreSqlTranslator,
))
.map(|r| r.as_ref().clone())
}
}

Expand Down

0 comments on commit 73564a4

Please sign in to comment.