joereynolds / joereynolds/sql-lint
Queries are incorrectly joined back together resulting in syntax errors
- Dominant language
- TypeScript
- Stars
- 459
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
### Steps to reproduce
With this query
```
SELECT AVG(Price), Manufacturer
FROM Products
GROUP BY Manufacturer;
```
It will fail as it is joined back together as
```
SELECT AVG(Price), Manufacturer FROM ProductsGROUP BY Manufacturer;
```
Whereas it works fine with
(Note the space before `GROUP`
```
SELECT AVG(Price), Manufacturer
FROM Products
GROUP BY Manufacturer;
```
It will be joined back together as
```
SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer;
```
### Actual behaviour
```
SELECT AVG(Price), Manufacturer
FROM Products
GROUP BY Manufacturer;
```
is joined as
```
SELECT AVG(Price), Manufacturer FROM ProductsGROUP BY Manufacturer;
```
### Expected behaviour
The query is joined back as
```
SELECT AVG(Price), Manufacturer FROM Products GROUP BY Manufacturer;
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.