Enhancement Requests for Beautifier

til

Member²
Three things i really miss in the Beautifier:
1) Leave a Blank between leading comma and following text.
2) New line after IF (indent the new line by one "tab").
3) Place closing brackets under opening brackets. This one is tricky, because it does not make sense for every bracket, only if the code in between has a certain complexity, i.e at least 2 items and/or exceeds a certain length
 
Please forgive a cross-post ( replied to a very old post before I saw this one )

Agree with Til's suggestions.

In addition:
1) Would like to add the ability to beautify trailing concatenation symbols to leading concatenation symbols - similar to the behaviour for commas eg would like output to look similar to following:-
begin
vSql := ' Select t1.col1 '
|| ' , t2.col2 '
|| ' , t2.col3 '
|| ' , ''constant'' as col4
|| ' from t1 '
|| ' join t2
|| ' on t1.col1 = t2.col1 '
|| ' and t1.col2 = t2.col2 '
|| ' where col3 = :bind1 ';
execute immediate vSql using vBind1 ;
end;

even better, would like a transform sql to generated sql function

so that I could select

vSql = ' Select t1.col1, t2.col2, t2.col3, ''constant'' as col4 from t1 join t2 on t1.col1 = t2.col1 and t1.col2 = t2.col2 where col3 = :bind1 ';

and transform it to pretty code per my prefered layout.

2. An additional option to use a trailing ||chr(10) on each of the new lines would allow me to ensure that the output code would be as pretty as the code to generate it.

Thanks
Zephya
 
Hi,

I'd prefer this format for the ||

vSQL := ' Select t1.col1 '
|| ' , t2.col2 '
|| ' , t2.col3 '
|| ' , ''constant'' as col4
|| ' FROM t1 '
|| ' JOIN t2
|| ' on t1.col1 = t2.col1 '
|| ' and t1.col2 = t2.col2 '
|| ' where col3 = :bind1 ';
 
ups, where are my tabs?

vSQL :=....' Select t1.col1 '
........||.' , t2.col2 '
........||.' , t2.col3 '
........||.' , ''constant'' as col4
........||.' FROM t1 '
........||.' JOIN t2
........||.' on t1.col1 = t2.col1 '
........||.' and t1.col2 = t2.col2 '
........||.' where col3 = :bind1 ';
 
Back
Top