simonw / django-sql-dashboard

Django app for building dashboards using raw SQL queries
https://django-sql-dashboard.datasette.io/
Apache License 2.0
437 stars 37 forks source link

Consider optional integration with SQLFluff #126

Open toolness opened 3 years ago

toolness commented 3 years ago

Via Podcast.init I learned about a tool called SQLFluff, which appears to be kind of like Black/Prettier/etc, but for SQL.

I frequently have trouble formatting SQL in a way that is readable and consistent, so an auto-formatting approach like this seems like it could be useful. Maybe Django SQL Dashboard could optionally support this tool, e.g. by auto-formatting a saved dashboard's SQL query, and/or via some kind of keyboard shortcut or button or somesuch?

Anyways, just a thought!

simonw commented 3 years ago

Oh interesting - I was thinking about adding the JavaScript formatted used by Datasette - see https://latest.datasette.io/fixtures - but I hadn't seen SQLFluff.