db-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From __matthewHawthorne <ma...@apache.org>
Subject Re: [sql] move from commons sandbox to db or db-commons?
Date Sat, 20 Dec 2003 15:59:25 GMT
> Unfortunately, [dbutils] doesn't. It has support for the 
> usually-better-practice of externalizing your queries, but it doesn't 
> have anything for dynamic construction of queries a la:
> QueryBuilder q = QueryBuilder.select().where("a.name like 
> {name}").leftOuterJoin("a", "b", "a.id = b.aid").all();
> String sql = q.getQueryString();
> // select * from a left outer join b on a.id = b.aid where a.name like ?
> Or the real case of having a delegating builder to build the query based 
> on various properties, or a switch, or even a classic chain of if's.
> It is the type of thing I have seen at least a dozen schemes for doing, 
> and have done a couple times myself -- a candidate for a common library, 
> in other words =)

I think this seems interesting.  I've never had a need for such a thing 
myself, but if you have, and others agree that it's a good idea, then I 
think it should be included.

 > 1) Why not Apache Commons?

 >> As one of the original authors I don't want it in Apache Commons and
 >> that should be a good enough reason.

I guess that's a good reason.  But, I also think that [sql] better falls 
under db.apache's domain.

 > 3) Any chance of a better name, ie) DDL and not SQL.

DDL is probably a better name.  The main purpose of the project is SQL 
generation, and also the ability to use beanutils.DynaBeans to exchange 
data with a database.  Any other opinions on the name?

View raw message