Comma at the begin for DDLs
Answered
Normally I like my commas at the end of the line, but for DDLs I need the at the beginning of the line (for our automatic code processor tool).
Is there any way to achieve this with the latest Datagrip?
Please sign in to leave a comment.
@...,
Could you specify the way you generate your DDL?
The DDL is just written in Datagrip (where I also format it), but I want to feed it to another tool that will process it.
Because of the way the tool works I need to have the commas at the end of the row. But maybe I am overcomplicating things, the other tool is also created by me, so I could make it work with the current syntax, but commas at the beginning of the line for DDLs would be nice anyway :)
@...,
You can configure SQL formatter the way you need and check reformat generated code
@... vasily chernov i too have this question. thanks for the suggestion vasily but in this case the DDL to create the table was not generated by datagrip but instead written by hand or pasted in from elsewhere, so for existing code, how can we format it to move the comma from the end to the front and align the data types? a macro would be fine. i tried to create one but it didn't do what i expected. Here's a sample of existing code. Can you tell us how to either include in formatting setup and/or write a macro for existing code?
Same problem here.
I want to change this format:
CREATE TABLE Foo (
a INT,
b INT
)
To this:
CREATE TABLE Foo (
a INT
, b INT
)
Strangely, there seems to be no way to do that in DataGrip (I am on version 2020.1). For all the other statement types, it is possible to put the comma at the beginning of the line. But no such thing for DDL
Thomas Kejser, Charmaine, @...,
I created an issue https://youtrack.jetbrains.com/issue/DBE-10575 based on your description. You can track progress and vote for the issue.