× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
SachinPrakash reported 2013-02-07T16:08:43Z  · tariqrahiman last modified 2016-10-26T19:32:54Z

SQL Formatter Enhancements


customer request
Priority Major
Complexity Unknown
Component Q Analyzer - SQL Formatter
Version Future

Customer suggestions:

 

1.       Line breaks (in formatter you can specify column in which ADS should break the line). ADS breaks line after dot “.” which in my opinion, and also more programmers, is a little bit annoying. My suggestion is to have an option to keep words separated by dot as a whole word.

Example (number of columns 90, field4 is separated from table name):

SELECT example_table.field1, example_table.field2, example_table.field3, example_table.

    field4, example_table.field5

FROM example_table

better would be:

SELECT example_table.field1, example_table.field2, example_table.field3,

    example_table.field4, example_table.field5

FROM example_table

               

2.       “BETWEEN … AND …” – System treats “AND” in the same way as “AND” in the query. In my opinion much more comfortable would be if there is an option not to break line “after/before” “AND” if it is part of “BETWEEN” clause. Formater do it like this (line breaks before AND/OR):

 

SELECT example_table.field1

FROM example_table

WHERE example_table.field1 = 'X'

    AND example_table.filed2 BETWEEN 1

    AND 2

    AND example_table.field3 = 4

 

Better would be:

 

SELECT example_table.field1

FROM example_table

WHERE example_table.field1 = 'X'

    AND example_table.filed2 BETWEEN AND 2

    AND example_table.field3 = 4

 

 

3.       In Oracle windowing function there is clause “ORDER BY” and “AND”. Formatter treat it in the same way as “ORDER BY” in query. As a result we get formatter query that looks like this:

 

SELECT example_table.field1, COUNT(1) over (partition BY field1

    ORDER BY field2 ROWS BETWEEN unbounded preceeding

        AND unbounded following)

FROM example_table

 

Better would be if system treat the part in brackets like subquery (BTW system could recognize key words: UNBOUNDED, PRECEEDING, FOLLOWING and CURRENT ROW) and make upper case word “PARTITION” (which is coloured like key word but is not made upper when option “Key word upper case” is ON in formatter):

 

SELECT example_table.field1, COUNT(1) over ( partition BY field1

    ORDER BY field2 ROWS BETWEEN unbounded preceeding AND unbounded following)

FROM example_table

 

4. Line Breaks after semi-colon

If you have numerous SQL statements on the same file, each ended by a semi-colon, and when you format the code all of the line breaks get removed making it difficult to read. It would be great to have an option in the SQL Formatter to line break after semi-colons.

 

 

1 attachment

Issue #8303

New
 
 
Completion
No due date
No fixed build
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017