Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-05-24 Thread Shantanu Kumar
On Apr 22, 10:32 pm, Shantanu Kumar wrote: > > I'm going to be working on clojure.java.jdbc, with Steve Gilardi, and > > I'd like to get people's feedback on what you like / what you don't > > like / what you need changed or added in clojure.contrib.sql so that > > clojure.java.jdbccan become wh

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-05-19 Thread Jim
On Apr 23, 9:38 am, Shantanu Kumar wrote: > > 5. Provide a mode to prevent write operations > > > Interesting idea but isn't that better handled by grants on the user > > accessing the database? > > The intention here is to proactively prevent errors from a development > standpoint. And then, so

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-05-02 Thread Sean Corfield
On Mon, May 2, 2011 at 5:33 PM, Justin Balthrop wrote: > What are your thoughts on handling connection pooling in clojure.java.jdbc. If there's a way to provide it in a portable manner without undue external dependencies, I'd be interested in exploring it but that gets a bit outside my familiarit

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-05-02 Thread Justin Balthrop
Sean, What are your thoughts on handling connection pooling in clojure.java.jdbc. We currently use c3po for connection pooling at Geni, but it seems that won't work as expected with the new shared thread bindings in Clojure 1.3. Since, the binding that holds the connection would be shared with

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-05-02 Thread Sean Corfield
On Tue, Apr 26, 2011 at 10:13 AM, Sean Corfield wrote: > I think at this point it makes sense to add a function to c.j.j that > mimics the current resultset-seq functionality but allows for the > application of naming strategies - with the default being the current > behavior, and some other stand

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-29 Thread Mibu
I think adding the generic sub-namespaces java, data, algo, tools, etc. is unnecessary and confusing. How many libraries fit neatly in one of those categories and not the other? Why use clojure.data.json when clojure.json would suffice? More examples: clojure.cli, clojure.enlive, clojure.monads

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-27 Thread Sean Corfield
Good point. Issue added to track that. On Wed, Apr 27, 2011 at 11:58 AM, Stuart Halloway wrote: > I'd like to at least have the option of passing SQL query strings > verbatim to the SQL server and getting returned data verbatim as well, > with no auto-quoting or column name munging at all (includ

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-27 Thread Stuart Halloway
> I'd like to at least have the option of passing SQL query strings > verbatim to the SQL server and getting returned data verbatim as well, > with no auto-quoting or column name munging at all (including > downcasing). Name-munging can be implemented on top of functions that > return data and col

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-27 Thread Brian Carper
On Apr 26, 10:13 am, Sean Corfield wrote: > On Tue, Apr 26, 2011 at 6:19 AM, David Powell wrote: > > There is justification for resultset-seq's current behaviour, even if it > > isn't to everyone's preference. > > Agreed. And I would actually want the lowercasing behavior to remain > the default,

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-27 Thread Nicolas Buduroi
On Tue, Apr 26, 2011 at 2:16 PM, lispnik wrote: > ...Liquibase so I can get rollbacks and branching easily. > Off-topic question: What does branching mean in the context of Liquidbase? > I suggest not getting into the SQL in sexps/naming strategies business. > That kind of thing doesn't really

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-27 Thread lispnik
Thanks for the feedback request. When I use clojure.contrib.sql, I use it for its DML only -- no create/drop table, etc. I usually manage the DDL outside of Clojure base using (for example) Liquibase so I can get rollbacks and branching easily. Perhaps DML can be factored out into a separate na

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-26 Thread Sean Corfield
On Tue, Apr 26, 2011 at 6:19 AM, David Powell wrote: > There is justification for resultset-seq's current behaviour, even if it > isn't to everyone's preference. Agreed. And I would actually want the lowercasing behavior to remain the default, for my own use anyway. What irks me more is the lack

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-26 Thread Stuart Halloway
> I don't want to make a breaking change to the existing API, but in a world > there there is an actively-maintained clojure.java.jdbc I don't think a > resultset function in core makes a lot of sense anyway. > > How about we mark core's resultset-seq as deprecated, with a link to the new > pro

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-26 Thread David Powell
> > > Yes, resultset-seq does lowercase the column names and it doesn't > translate between - / _ either. But that's not part of c.j.j so, > whilst I may agree with the criticisms of it, I can't actually fix > that :) > > There is justification for resultset-seq's current behaviour, even if it isn'

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-26 Thread Stuart Halloway
>> Also see related problems reported by others: >> http://osdir.com/ml/clojure/2010-10/msg00290.html (sorry, can't find >> it on the group.) > > Yes, resultset-seq does lowercase the column names and it doesn't > translate between - / _ either. But that's not part of c.j.j so, > whilst I may agre

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-25 Thread Nicolas Buduroi
On Mon, Apr 25, 2011 at 12:23 PM, Michael wrote: > I was wondering if c.j.jdbc could provide some help in composing sql > fragments, but I'm not sure what form it should take or if core > clojure would suffice. We would have looked into ClojureQL, but it > doesn't directly support Oracle. Would a

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-25 Thread Michael
We've been using iBatis (http://ibatis.apache.org/) to compose sql fragments and map to java objects. iBatis has since forked from Apache to become mybatis (http://www.mybatis.org/). With iBatis, you can use XML to attach an identifier to sql fragments. You can build up sql expressions by referenc

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-24 Thread Michael Wood
On 23 April 2011 23:53, Nicolas Buduroi wrote: > On Saturday, 23 April 2011 17:33:48 UTC-4, Sean Corfield wrote: >> >> Well, not all DB stropping approaches are simply (str q ident q) - >> >> there's also select [name] from [table] style quoting and that part is >> >> DB vendor specific I believe?

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-24 Thread Shantanu Kumar
Just to point out what's not supported by resultset-seq: 1. Flexible conversion of column label to a Clojure equivalent. 2. Handling of duplicate column labels in a resultset. For example, this is a perfectly valid SQL statement in MySQL: SELECT productId, productId+4 as productId FROM `t_product

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Nicolas Buduroi
On Saturday, 23 April 2011 17:33:48 UTC-4, Sean Corfield wrote: > > Well, not all DB stropping approaches are simply (str q ident q) - there's also select [name] from [table] style quoting and that part is DB vendor specific I believe? Oh yeah, I forgot SQL Server again! (with-quoted-identif

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Sean Corfield
On Sat, Apr 23, 2011 at 1:37 PM, Nicolas Buduroi wrote: > After rethinking about quoted identifiers, I realized they would probably > need an extra argument to escape the quotes found inside an identifier if > there are some. Well, not all DB stropping approaches are simply (str q ident q) - ther

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Nicolas Buduroi
On Saturday, 23 April 2011 16:15:57 UTC-4, Sean Corfield wrote: > > Should [:some-schema :a-table] become "some_schema.a_table"? > > How do people want to handle mixed case entity names? Do we want > something like Hibernate Naming Strategies? > I hadn't thought about naming strategies that could b

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Sean Corfield
On Sat, Apr 23, 2011 at 10:13 AM, Nicolas Buduroi wrote: > What I would like to see added is a global connection mechanism like in > ClojureQL and Lobos. We could even add a connection pool behind the scene. Thanx. I'll take a look at those. > Then there's support for quoted identifiers, maybe s

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Sean Corfield
On Sat, Apr 23, 2011 at 10:01 AM, Stuart Sierra wrote: > One snag I ran into recently with c.c.sql: it creates structmaps for > returning query results, which means you can't subsequently dissoc one > of the keys without converting to a regular map. That's down to resultset-seq - should c.j.j sto

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Sean Corfield
I've added an issue for getting access to generated SQL and possibly execution statistics. On Sat, Apr 23, 2011 at 1:38 AM, Shantanu Kumar wrote: > Some databases (under certain configuration) work only with case- > sensitive entity names. Converting them to all lowercase breaks under > those sit

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Nicolas Buduroi
> > I'm going to be working on clojure.java.jdbc, with Steve Gilardi, and > I'd like to get people's feedback on what you like / what you don't > like / what you need changed or added in clojure.contrib.sql so that > clojure.java.jdbc can become what the community wants for 1.3.0. What I would l

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Stuart Sierra
One snag I ran into recently with c.c.sql: it creates structmaps for returning query results, which means you can't subsequently dissoc one of the keys without converting to a regular map. In general, c.c.sql is inconsistent about using tuples of column values versus maps of column=>value pairs. B

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-23 Thread Shantanu Kumar
> > 1. Allow _ (underscore) in field names > > This already seems to work. I just tested the following - can you elaborate: Yes, I tested this and it seems to work now. Not sure where I noticed earlier where it was not working. My bad. > > I agree that translating - / _ would be more idiomatic. I

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-22 Thread Sean Corfield
On Fri, Apr 22, 2011 at 10:32 PM, Shantanu Kumar wrote: > Listed below: Thank you! > 1. Allow _ (underscore) in field names This already seems to work. I just tested the following - can you elaborate: (deftest test-create (jdbc/with-connection (worldsingles-db) (jdbc/create-table :jdbcTe

Re: clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-22 Thread Shantanu Kumar
> I'm going to be working on clojure.java.jdbc, with Steve Gilardi, and > I'd like to get people's feedback on what you like / what you don't > like / what you need changed or added in clojure.contrib.sql so that > clojure.java.jdbc can become what the community wants for 1.3.0. Thanks for asking

clojure.contrib.sql => clojure.java.jdbc - looking for feedback!

2011-04-22 Thread Sean Corfield
As part of the 1.3.0 release process, several of the old clojure.contrib.* libraries are being picked up and "promoted" into a new hierarchy of namespaces which you can see here: https://github.com/clojure The discussion / rationale is here: http://dev.clojure.org/display/design/Contrib+Library+