You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a formatter for SQL files so they follow a opinionated standard.
Current Situation
No response
Why do we need this? Who uses it, and when?
We have formatters defined for most off our codebase, except for the SQL files. Adding this will make our queries more consistent.
Proposed Implementation
The formatter that we choose has to work with postgres/timescaledb and ignore the ?0 syntax that we use for our bun replacements.
These requirements led to one option so far: sqlfmt. It is very opinionated, the only parameter is line length. But it quite resembles our current "style".
sqlfmt now supports our naming structure and the bun placeholders. I think it to be a good fit for the stack, however not all postgress keywords are supported yet. This means that the formatting may change when the development moves along.
My proposal is to add the formatter as is and keep track of tconbeer/sqlfmt#262 to update it accordingly. This can be done by switching out the docker container in mage.
Summary
Add a formatter for SQL files so they follow a opinionated standard.
Current Situation
No response
Why do we need this? Who uses it, and when?
We have formatters defined for most off our codebase, except for the SQL files. Adding this will make our queries more consistent.
Proposed Implementation
The formatter that we choose has to work with
postgres
/timescaledb
and ignore the?0
syntax that we use for ourbun
replacements.These requirements led to one option so far: sqlfmt. It is very opinionated, the only parameter is line length. But it quite resembles our current "style".
Others I've tried (SQLFluff and sql-formatter) fail on the special syntax.
Contributing
Code of Conduct
The text was updated successfully, but these errors were encountered: