sql-formatter-org / sql-formatter-org/sql-formatter
missing -- sql comment support for disable formatting
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Description
In MariaDB you can't use /* comment */ and need to use -- comment to disable formatting in mariadb sql files for queries, it would be handy to be able to use -- instead like so:
SELECT
-- sql-formatter-disable
sqlc.embed(users),
-- sql-formatter-enable
customers.id
FROM
customers
JOIN users ON users.customer_id = customers.id
My personal issue is the issue that this formatter adds a space after embed for my golang sqlc project (see #913)
--- sqlc.embed(users)
+++ sqlc.embed (users)
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
Start at src/lexer/Tokenizer.ts#L37 and trace how formatting-disable and formatting-enable comments are recognized. Support the requested -- marker form for MariaDB SQL, preserving the existing behavior for block comments, and verify the example remains unchanged between the markers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mariadb, sql, typescript
- Domain
- databases, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100