sql-formatter-org / sql-formatter-org/sql-formatter
Feature Request: Support for sqlc
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Description
Describe the Feature
SQLc uses custom non-standard sql that is converted to sql after embedding into a .go file.
Sql-formatter formats these macros incorrectly.
https://docs.sqlc.dev/en/latest/reference/macros.html
Why do you want this feature?
sqlc attempts to use plain sql files to generate type checked embedded sql queries for mysql, postgres & sqlite. I've found sql-formatter pretty handy except for this one issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the linked sqlc macro documentation first to understand the non-standard SQL syntax that must be preserved or formatted correctly. Then locate the formatter's SQL parsing entry point and test coverage; done means sqlc macro queries no longer format incorrectly while ordinary MySQL, PostgreSQL, and SQLite SQL still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sql, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100