fixes #338 by adding ONLY to :fetch
This commit is contained in:
parent
994f166d40
commit
7e84b58463
4 changed files with 10 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -11,6 +11,7 @@
|
|||
.settings
|
||||
.socket-repl-port
|
||||
.sw*
|
||||
.vscode
|
||||
*.class
|
||||
*.jar
|
||||
*.swp
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
# Changes
|
||||
|
||||
* 2.0.next in progress (2.x will be VGN only)
|
||||
* Fix #338 by adding `ONLY` to `:fetch`.
|
||||
* Fix #337 by switching to `clojure.test` even for ClojureScript.
|
||||
* Address #330 by improving exception when a non-entity is encountered where an entity is expected.
|
||||
* Fix bug in unrolling nested argument to `with-columns` helper.
|
||||
|
|
|
|||
|
|
@ -870,7 +870,9 @@
|
|||
:order-by #'format-order-by
|
||||
:limit #'format-on-expr
|
||||
:offset #'format-on-expr
|
||||
:fetch #'format-on-expr
|
||||
:fetch (fn [_ x]
|
||||
(let [[sql & params] (format-on-expr :fetch x)]
|
||||
(into [(str sql " " (sql-kw :only))] params)))
|
||||
:for #'format-lock-strength
|
||||
:lock #'format-lock-strength
|
||||
:values #'format-values
|
||||
|
|
|
|||
|
|
@ -782,3 +782,8 @@ ORDER BY id = ? DESC
|
|||
:from :bar
|
||||
:join [[{:select :a :from :b :where [:= :id 123]} :x] :y]
|
||||
:where [:= :id 456]})))))
|
||||
|
||||
(deftest fetch-offset-issue338
|
||||
(is (= ["SELECT foo FROM bar OFFSET ? FETCH ? ONLY" 20 10]
|
||||
(format {:select :foo :from :bar
|
||||
:fetch 10 :offset 20}))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue