format-my-sql
v1.0.3
Published
Inject parameters into raw SQL and format the result — CLI tool
Maintainers
Readme
format my sql
Inject parameters into raw SQL and format the result — CLI & web tool.
# one query
sqlformat "SELECT * FROM t WHERE id = ?" "[42]"
# batch from file (pairs: SQL line, params line)
cat queries.txt | sqlformat > formatted.sqlInstall
sudo npm install -g format-my-sqlor via npx:
npx -p format-my-sql sqlformat "SELECT * FROM t WHERE id = ?" "[42]"Placeholder styles
| Style | Example | Params |
|-------|---------|--------|
| ? | WHERE id = ? | [1] |
| $1 | WHERE id = $1 | [1] |
| :name | WHERE id = :id | {"id":1} |
Web
Client-side only, no backend → formatmysql.vercel.app
License
MIT
