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

Treat sqlite cli commands as comments #1034

Open
1 task done
kmerfeld opened this issue Dec 4, 2024 · 1 comment
Open
1 task done

Treat sqlite cli commands as comments #1034

kmerfeld opened this issue Dec 4, 2024 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@kmerfeld
Copy link

kmerfeld commented Dec 4, 2024

What would you like to see?

Currently this doesn't parse sqlite's cli commands.
https://sqlite.org/cli.html#special_commands_to_sqlite3_dot_commands_

I tend to have a scratch.sql file around that I treat like a repl.

it will often look like

.mode table
.headers ON
.nullvalue NULL

select name, title from a inner join b on a.title = b.title where b.field = 'data'

when the cli commands are included, the sql gets formatted as

select name,
title from a inner join b on a.title = b.title where b.field = 'data'

without them, it gets formatted as

select
    name,
    title
from a
inner join b on a.title = b.title
where b.field = 'data'

Ideally sqruff would just treat the cli commands as comments

Checked issues

  • I have checked this request in the issues.
@kmerfeld kmerfeld added the enhancement New feature or request label Dec 4, 2024
@benfdking
Copy link
Collaborator

Hi @kmerfeld,

Thanks for trying the tool and for filing the request!

While we can envisage this as a feature based on templaters that hides the statements from the linter before it considers them, we currently see this request as slightly outside the scope of the project, and we don't really have the capacity to do it.

We're happy to support any contributions though.

@benfdking benfdking added the wontfix This will not be worked on label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants