sql-formatter-org / sql-formatter-org/sql-formatter
[FORMATTING] Formatter Adds Unwanted Space Before Dash and Number in Project Names (e.g., project -12345)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 456
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 3
Description
Whenever a project name contains a dash followed by a number then it is being interpreted as a minus number value and being separated when formatted. This is troublesome for us as a lot of our project names contain this format and the formatter is breaking our queries as a result.
We can't always rely on escaping the project name as these queries are written by end users in the browser.
Input data
-- BigQuery
select * from project-12345.table.column
Expected Output
select
*
from
project-12345.table.column
Actual Output
select
*
from
project -12345.table.column
Usage
- What SQL language(s) does this apply to?
BigQuery - Which SQL Formatter version are you using?
15.4.5
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
Reproduce the BigQuery example with sql-formatter 15.4.5 and compare the expected and actual output shown in the issue. Trace the BigQuery formatting path to find where project-12345 is split around the dash, then verify that the formatted query preserves project-12345 and does not insert a space.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, sql, typescript
- Domain
- databases, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100