Skip to content

Commit

Permalink
Merge PR#20
Browse files Browse the repository at this point in the history
  • Loading branch information
lelit committed Apr 4, 2019
2 parents 35fded1 + 02b2fe5 commit 02f0836
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
32 changes: 16 additions & 16 deletions pglast/printers/dml.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,22 +765,22 @@ def select_stmt(node, output):
output.newline()
output.write('WINDOW ')
output.print_list(node.windowClause)
if node.sortClause:
output.newline()
output.write('ORDER BY ')
output.print_list(node.sortClause)
if node.limitCount:
output.newline()
output.write('LIMIT ')
output.print_node(node.limitCount)
if node.limitOffset:
output.newline()
output.write('OFFSET ')
output.print_node(node.limitOffset)
if node.lockingClause:
output.newline()
output.write('FOR ')
output.print_list(node.lockingClause)
if node.sortClause:
output.newline()
output.write('ORDER BY ')
output.print_list(node.sortClause)
if node.limitCount:
output.newline()
output.write('LIMIT ')
output.print_node(node.limitCount)
if node.limitOffset:
output.newline()
output.write('OFFSET ')
output.print_node(node.limitOffset)
if node.lockingClause:
output.newline()
output.write('FOR ')
output.print_list(node.lockingClause)

if node.withClause:
output.dedent()
Expand Down
11 changes: 11 additions & 0 deletions tests/test_printers_roundtrip/dml/select.sql
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,17 @@ SELECT * FROM "T"
UNION ALL
SELECT * FROM "T"
SELECT * FROM "T"
UNION ALL
SELECT * FROM "T"
ORDER BY 1, 2, 3
SELECT * FROM "T"
UNION ALL
SELECT * FROM "T"
ORDER BY 1, 2, 3
LIMIT 2 OFFSET 1
WITH RECURSIVE employee_recursive("Distance", employee_name, manager_name) AS (
SELECT 1, employee_name, manager_name
FROM employee
Expand Down

0 comments on commit 02f0836

Please sign in to comment.