SQL-in-JS formatting 😍
Karl Horky
Visit on X@karlhorky2K followers
45,068 views
SQL-in-JS formatting 😍
This is possible thanks to prettier-plugin-embed by Sec-ant (Ze-Zheng Wu), prettier-plugin-sql by JounQin, sql-formatter by Rene Saarsoo
Setup Guide:
6 Comments
Comments from the original post on X (Twitter)

@karlhorky
Give these projects a star 🌟 prettier-plugin-embed by Sec-ant (Ze-Zheng Wu)
1 like

@karlhorky
prettier-plugin-sql by @JounQin

@karlhorky
sql-formatter by @renku
1 like

@karlhorky
More great SQL tooling here:
1 like

@antonrevyako
@JounQin @renku Why are you storing sql in js? Put it in a separate file, it will bring many benefits

@karlhorky
@JounQin @renku SQL-in-JS allows you to integrate with JavaScript and TypeScript: 1. Interpolation of runtime JavaScript values (eg. function parameters) 2. SQL closer to your logic (colocation) 3. Checking against TypeScript types Etc. Lots of benefits of having it in your JS/TS
1 like