-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move some implementation from format to impl ns.
Fixes #18
- Loading branch information
Showing
2 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
;; Copyright (c) 2014, Andrey Antukh <[email protected]> | ||
;; Copyright (c) 2014-2017 Andrey Antukh <[email protected]> | ||
;; All rights reserved. | ||
;; | ||
;; Redistribution and use in source and binary forms, with or without | ||
|
@@ -33,31 +33,6 @@ | |
org.jooq.impl.DefaultConfiguration | ||
org.jooq.impl.DSL)) | ||
|
||
(extend-protocol proto/IRenderer | ||
org.jooq.Query | ||
(-sql [q type dialect] | ||
(let [^Configuration conf (DefaultConfiguration.) | ||
^DSLContext context (DSL/using conf)] | ||
(when dialect | ||
(.set conf (impl/translate-dialect dialect))) | ||
(condp = type | ||
nil (.render context q) | ||
:named (.renderNamedParams context q) | ||
:indexed (.render context q) | ||
:inlined (.renderInlined context q)))) | ||
|
||
(-bind-values [q] | ||
(let [^Configuration conf (DefaultConfiguration.) | ||
^DSLContext context (DSL/using conf)] | ||
(into [] (.extractBindValues context q)))) | ||
|
||
suricatta.types.Deferred | ||
(-sql [self type dialect] | ||
(proto/-sql @self type dialect)) | ||
|
||
(-bind-values [self] | ||
(proto/-bind-values @self))) | ||
|
||
(defn sql | ||
"Renders a query sql into string." | ||
([q] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters