I'm using Data Grip and writing queries for use with Presto. How can I get Data Grip to format my queries so they will be neat and easy to read?
Data Grip - how do I perform a simple SQL formatting (the same way ctrl+shift+F does in DBeaver)?
Asked Answered
Ctrl/Cmd+Alt+L
formats your code.
Settings | Editor | Code Style | SQL
to adjust.
Hi @Sporty I've tried that and it does absolutely nothing! It will say "No lines changed: content is already properly formatted" even when the code is not formatted! any ideas? –
Abagail
@Abagail That means that your code is formatted according to defined code style. You need to set up code style to match you expectations –
Frightened
@Frightened I've set up code style, and yet nothing happens. I can write a super-long line and then press Ctrl+Alt+L and it won't even wrap the text. Any ideas? –
Abagail
Hm, are you editing the SQL file or a console? What dialect do you use? A screencast will be useful here –
Sporty
Hi @moscas, I've added two screenshots, hope that's helpful. I'm writing in Presto which should be general SQL. Appreciate your help here. –
Abagail
Got it! The formatter doesn't wok for the dialects which are not supported. It will be fixed in 2020.3 –
Sporty
Mac: Cmd + Option + L –
Shalon
© 2022 - 2024 — McMap. All rights reserved.