AltimateAI / AltimateAI/vscode-dbt-power-user

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

Aperta
#1,454 1 commento 1 reazione 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
JavaScript
Stelle
585
Fork
121
Merge medio
5g 39m
PR unite (30g)
4

Descrizione

### 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!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.