-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix regression on selectStarOfAliases and clickhouse replace (#71)
* Fix regression on selectStarOfAlias and clickhouse replace * update docs
- Loading branch information
1 parent
baec361
commit 629b3e0
Showing
5 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { dsql, table } from "../../src"; | ||
|
||
test("selectStarOfAliases", () => { | ||
const cols = ["a", "b"] as const; | ||
const q = table(cols, "t") | ||
.select((_f) => ({ a: dsql(1) })) | ||
.as("m") | ||
.join("LEFT", table(cols, "t").selectStar().as("a2")) | ||
.noConstraint() | ||
.selectStarOfAliases(["a2"]) | ||
.clickhouse.replace((f) => [["a", f.a2.a]]); | ||
|
||
expect(q.stringify()).toMatchInlineSnapshot( | ||
`"SELECT a2.* REPLACE (\`a2\`.\`a\` AS \`a\`) FROM (SELECT 1 AS \`a\` FROM \`t\`) AS \`m\` LEFT JOIN (SELECT * FROM \`t\`) AS \`a2\`"` | ||
); | ||
}); |