AltimateAI / AltimateAI/vscode-dbt-power-user

"Execute Query" should allow for a no-limit option that does not run as a subquery

Offen
#1,454 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
JavaScript
Sterne
585
Forks
121
Ø Merge
5 T. 39 Min.
Gemergte PRs (30 T.)
4

Beschreibung

### Describe the feature

"Execute Query" forces a limit and runs the query as
```
select *
from {
-- the sql
}
limit 500
```

This has the effect that it can change the behavior of the inner sql if the inner sql has ORDER BY, as ORDER BY is guaranteed to apply only to the SELECT statement it's attached to, and has no guarantee that it will be preserved accross subqueries. So if I have a query like

```
select *
from foo
order by bar
```

and I execute it, the resulting order I get in the results tab will not necessarily be ordered by bar, nor will it be ordered in the same fashion every time, nor will it necessarily give me the same limitted count of rows every time. It lead to a lot of confusion when debugging queries.

It would be super super useful to allow the limit of rows to be set to 0 / nonexistent, and when that happens remove the subquery template and just run the query as is.

### Describe alternatives you've considered

_No response_

### Who will benefit?

_No response_

### Are you willing to submit PR?

- [x] Yes I am willing to submit a PR!

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.