r0man/sqlingvo — pull request #18 by temochka (2014-08-14 03:22:46+00:00)
Title: Do not use LIMIT ALL

LIMIT ALL is not supported by some major SQL databases, i.e. MySQL, SQLite. MS SQL Server and Oracle do not support the LIMIT statement completely. In any way, I believe the library should not automatically add any unexpected syntax.

It is useful to be able to remove existing LIMIT statements though. Especially when composing multiple queries, i.e.:

``` clojure
(sql (compose (select [:*] (from :users) (limit 10)) (limit nil)))
;;; (sql (compose (select [:*] (from :users) (limit 10)) (limit nil)))
```

This change omits LIMIT section completely if a given value is not a number. I was also going to suggest a similar behavior for OFFSET, but it looks like OFFSET 0 (existing behavior) is widely supported and doesn’t cause any visible problems.