forked from sqldelight/sqldelight
-
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.
Add 5199 support postgresql order by nulls (sqldelight#5229)
* Add PostgreSql Order By Nulls Add grammar * Add fixture tests
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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
28 changes: 28 additions & 0 deletions
28
dialects/postgresql/src/testFixtures/resources/fixtures_postgresql/order-by-nulls/Sample.s
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,28 @@ | ||
CREATE TABLE table_name( | ||
column1 TEXT, | ||
column2 DATE, | ||
column3 INTEGER | ||
); | ||
|
||
SELECT column1, column2 | ||
FROM table_name | ||
ORDER BY column1 NULLS FIRST, column2 DESC; | ||
|
||
SELECT column1, column2 | ||
FROM table_name | ||
ORDER BY column1 DESC NULLS LAST, column2; | ||
|
||
SELECT column1, column2, column3 | ||
FROM table_name | ||
ORDER BY column1 NULLS FIRST, column2 NULLS LAST, column3; | ||
|
||
SELECT | ||
column1, | ||
column2, | ||
column3 | ||
FROM | ||
table_name | ||
ORDER BY | ||
column1 ASC, | ||
column2 DESC, | ||
column3; |