Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatting mangles GLOB parameters for SQLite dialect #69

Open
linusjf opened this issue Dec 21, 2024 · 0 comments
Open

Formatting mangles GLOB parameters for SQLite dialect #69

linusjf opened this issue Dec 21, 2024 · 0 comments

Comments

@linusjf
Copy link

linusjf commented Dec 21, 2024

The following SQL statements are fed to the formatter:

SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB 'Man*';


SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB '*Man';


SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB '?ere*';

SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB '*[1-9]*';

SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB '*[^1-9]*';
SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB '*[1-9]';

The dialect is SQLite.

The string literal that follows keyword GLOB should remain unchanged.

However, the output is as follows:

SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' Man * ';
SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' * Man ';
SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' ? ere * ';

SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' * [1-9] * ';
SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' * [^1-9] * ';
SELECT
	trackid,
	name
FROM
	tracks
WHERE
	name GLOB ' * [1-9] ';

It would be nice to have a way to have the parser ignore certain SQL statements if there isn't a solution at the moment.

sleek version: 0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant