sql-formatter-org / sql-formatter-org/sql-formatter

Feature Request: Support for sqlc

Open
#913 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.