Questions/suggestions

1 view
Skip to first unread message

Shantanu Kumar

unread,
Nov 11, 2010, 8:50:34 AM11/11/10
to clj-sql
Hi, I have couple of questions/suggestions.

1. Dependency on contrib, especially c.c.sql

Does it make sense to remove the dependency on other contrib libs so
as to make it forward compatible with Clojure 1.3? I think this
implies pulling code from those and putting directly into clj-sql.


2. Batch queries and batch size

Currently 'do-commands' seems to be running the queries inside a
batch. It may be useful to expose a global batch enclosure (using a
macro) and let users override a default batch size (50, for example):

;; default batch size
(with-batch
..)

(with-batch-of-size 75
..)

It should be possible to detect the batch mode (and size), and execute
unsafe statements inside a batch if applicable.

Regards,
Shantanu

Saul Hazledine

unread,
Nov 11, 2010, 10:39:06 AM11/11/10
to clj-sql
On Nov 11, 2:50 pm, Shantanu Kumar <kumar.shant...@gmail.com> wrote:
> Hi, I have couple of questions/suggestions.
>
> 1. Dependency on contrib, especially c.c.sql
>
> Does it make sense to remove the dependency on other contrib libs so
> as to make it forward compatible with Clojure 1.3? I think this
> implies pulling code from those and putting directly into clj-sql.
>

Clojure 1.3 is still alpha but the the changeover will need to be
dealt with. As I see it, a future 1.3 compatible version should depend
on just clojure.contrib.sql. Personally, I don't like copying code
from c.c.sql into clj-sql - I have seen projects get into trouble
when they copy everything and it would be nice to remove code when
c.c.sql implements new features.

I like your previous suggestion of having a 1.3 compatible branch.
Would this be OK on github or would you need it on clojars too? As I
see it, the problem with putting it on clojars is that having two
alternatives of the same package breaks semantic versioning.

> 2. Batch queries and batch size
>
> Currently 'do-commands' seems to be running the queries inside a
> batch. It may be useful to expose a global batch enclosure (using a
> macro) and let users override a default batch size (50, for example):
>
> ;; default batch size
> (with-batch
>   ..)
>
> (with-batch-of-size 75
>   ..)
>
> It should be possible to detect the batch mode (and size), and execute
> unsafe statements inside a batch if applicable.
>

I can look into doing this. As an alternative, free free to fork and
make a pull request. Also, do you want commit access to the github
repository and clojars group? That way you can make changes and do
releases. So far, clj-sql has been a collaborative effort with people
putting in features as they need them.

Saul
Reply all
Reply to author
Forward
0 new messages