uptrace / bun

SQL-first Golang ORM
https://bun.uptrace.dev
BSD 2-Clause "Simplified" License
3.47k stars 210 forks source link

fix: allow LIMIT 0 for SELECT queries #918

Open ygabuev opened 8 months ago

ygabuev commented 8 months ago

This PR enables the correct queries of form SELECT ... LIMIT 0. Before that, the limit-clause wasn't applied to the query.

Closes https://github.com/uptrace/bun/issues/801

ygabuev commented 8 months ago

The new tests fail for mssql, I've checked and they also fail for current master. Given that there were no tests for the LIMIT clause, I have a felling that the implementation for LIMIT and/or OFFSET is broken for mssql.

If this is true, it might be a better idea to fix those in a separate PR.

UPD: this ticket seems related https://github.com/uptrace/bun/issues/811

vmihailenco commented 6 months ago

@ygabuev this looks good, but I can't merge a PR that breaks the build....