Re: [ANN] clojure.java.jdbc 0.5.6 -- important deprecations!

2016-04-10 Thread Sean Corfield
On 4/10/16, 11:59 AM, "Colin Yates"  wrote:
>That's great Sean - I look forward to 'lein ancient'ing tomorrow :-).

You’ll want to use 0.5.7 (just landed on Maven Central right now) to pick up a 
bug fix for a problem I discovered in 0.5.6 after release -- the following new 
syntax did not work:

(insert! db table [:col] [“val”] {})

I’ve added more test coverage to ensure I don’t break more stuff in 0.6.0 when 
all the deprecated functionality is removed!

There will be a 0.5.8 release (probably tomorrow?) that cleans up 
`db-do-commands` and `db-do-prepared` -- they’re the last two variadic 
functions left in the library and now that I have everything else cleaned up, 
they’re bugging me! ☺

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)





-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] clojure.java.jdbc 0.5.6 -- important deprecations!

2016-04-10 Thread Colin Yates
That's great Sean - I look forward to 'lein ancient'ing tomorrow :-).

On 10 April 2016 at 18:42, Sean Corfield  wrote:
> What?
> org.clojure/java.jdbc “0.5.6”
> Clojure contrib wrapper for JDBC database operations
>
> Where?
> https://github.com/clojure/java.jdbc#change-log
>
> TL;DR:
> Variadic calls to most functions have been deprecated in favor of 
> fixed argument calls in order to make the functions more composable in use. 
> This affects any calls that provided options, as well as any `insert!` that 
> inserted multiple rows!
>
> Why?
> In the previous versions (0.5.0 and earlier), options to most 
> functions were specified as inline unrolled keyword/value arguments:
>
> (jdbc/query db [“select * from foo where id = ?” pk]
>  :row-fn :name :result-set-fn first :identifiers identity)
>
> Whilst this style of argument is convenient from the REPL, it becomes 
> increasingly awkward as you start composing functions – you start having to 
> use `apply` and `mapcat identity` and so on.
>
> Version 0.5.5 introduced a single options map argument into (nearly) 
> all functions that previously took unrolled keyword/value arguments. It is 
> the optional, last argument in all cases.
>
> (jdbc/query db [“select * from foo where id = ?” pk]
>  {:row-fn :name :result-set-fn first :identifiers 
> identity})
>
> Version 0.5.6 extends this to `create-table-ddl` and `insert!`. It 
> also introduces `insert-multi!` and deprecates the multi-row capability of 
> `insert!` -- the variadic call:
>
> ;; deprecated
> (jdbc/insert! db {:row “1” :data “first”} {:row “2” :data “second”})
>   (jdbc/insert! db [:row :data] [“3” “third”] [“4” “fourth”])
> ;; use this instead
> (jdbc/insert-multi! db [{:row “1” :data “first”}
>   {:row “2” :data “second”}])
>   (jdbc/insert-multi! db [:row :data]
>  [[“3” “third”]
>   [“4” “fourth”]])
>
>Version 0.5.6 continues to support the unrolled arguments but 
> considers them deprecated – and using them will cause a DEPRECATED message to 
> be printed to stdout (this was already true for `db-transaction` which was 
> deprecated in favor of `with-db-transaction` back in version 0.3.0).
>
> Plans?
> Version 0.6.0 will remove all deprecated functionality (including the 
> old API which continued in java.jdbc.deprecated for several versions).
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ANN] clojure.java.jdbc 0.5.6 -- important deprecations!

2016-04-10 Thread Sean Corfield
What?
org.clojure/java.jdbc “0.5.6”
Clojure contrib wrapper for JDBC database operations

Where?
https://github.com/clojure/java.jdbc#change-log

TL;DR:
Variadic calls to most functions have been deprecated in favor of fixed 
argument calls in order to make the functions more composable in use. This 
affects any calls that provided options, as well as any `insert!` that inserted 
multiple rows!

Why?
In the previous versions (0.5.0 and earlier), options to most functions 
were specified as inline unrolled keyword/value arguments:

(jdbc/query db [“select * from foo where id = ?” pk]
 :row-fn :name :result-set-fn first :identifiers identity)

Whilst this style of argument is convenient from the REPL, it becomes 
increasingly awkward as you start composing functions – you start having to use 
`apply` and `mapcat identity` and so on.

Version 0.5.5 introduced a single options map argument into (nearly) 
all functions that previously took unrolled keyword/value arguments. It is the 
optional, last argument in all cases.

(jdbc/query db [“select * from foo where id = ?” pk]
 {:row-fn :name :result-set-fn first :identifiers identity})

Version 0.5.6 extends this to `create-table-ddl` and `insert!`. It also 
introduces `insert-multi!` and deprecates the multi-row capability of `insert!` 
-- the variadic call:

;; deprecated
(jdbc/insert! db {:row “1” :data “first”} {:row “2” :data “second”})
  (jdbc/insert! db [:row :data] [“3” “third”] [“4” “fourth”])
;; use this instead
(jdbc/insert-multi! db [{:row “1” :data “first”}
  {:row “2” :data “second”}])
  (jdbc/insert-multi! db [:row :data]
 [[“3” “third”]
  [“4” “fourth”]])

   Version 0.5.6 continues to support the unrolled arguments but considers 
them deprecated – and using them will cause a DEPRECATED message to be printed 
to stdout (this was already true for `db-transaction` which was deprecated in 
favor of `with-db-transaction` back in version 0.3.0).

Plans?
Version 0.6.0 will remove all deprecated functionality (including the 
old API which continued in java.jdbc.deprecated for several versions).

Sean Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)







-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.