Joe Walnes has released Squiggle, a small Java library for dynamically building complicated SQL SELECT statements. Squiggle is open source code that has one missions only: It generates SELECT statements based on criteria you give it. It's sweet spot is for applications that need to build up complicated queries with criteria that changes at runtime.
Features
- Concise and intuitive API.
- Simple code, so easy to customize.
- No dependencies on classes outside of JDK1.2.
- Small, lightweight, fast.
- Generates clean SQL designed that is very human readable.
- Supports joins and sub-selects.
Links
Visit the Squiggle tutorial to see how it all works.
Squiggle Home Page
Download Squiggle (zip, tgz)
-
Squiggle SQL Builder for Java Released (8 messages)
- Posted by: Dion Almaer
- Posted on: January 08 2004 09:36 EST
Threaded Messages (8)
- How does it compare with Hibernate Query by Criteria? by c tang on January 08 2004 13:23 EST
- Squiggle SQL Builder for Java Released by Vladimir Goncharov on January 08 2004 14:39 EST
- What about INSERT, UPDATE, DELETE ??? by gl c on January 08 2004 18:00 EST
- Good work by Ganesh Prasad on January 08 2004 18:08 EST
- Yet another util libray by Linards Kanenbergs on January 09 2004 02:58 EST
- Actually.... by Hani Suleiman on January 09 2004 09:10 EST
- Thanks Hani by Linards Kanenbergs on January 09 2004 01:11 EST
- Actually.... by Hani Suleiman on January 09 2004 09:10 EST
- just the select? by jag huang on January 11 2004 19:39 EST
-
How does it compare with Hibernate Query by Criteria?[ Go to top ]
- Posted by: c tang
- Posted on: January 08 2004 13:23 EST
- in response to Dion Almaer
How does squiggle compare with the Query by Criteria feature of Hibernate?
Thanks!
ct -
Squiggle SQL Builder for Java Released[ Go to top ]
- Posted by: Vladimir Goncharov
- Posted on: January 08 2004 14:39 EST
- in response to Dion Almaer
Is this DB aware and can represent convert(), TO_CHAR, sysdate, current, AVG, SUM, etc. for different database. Otherwise the entire idea doesnt make sense, I guess. -
What about INSERT, UPDATE, DELETE ???[ Go to top ]
- Posted by: gl c
- Posted on: January 08 2004 18:00 EST
- in response to Dion Almaer
Cool Tools.....
What about INSERT, UPDATE, DELETE ???
Any plan for it??? -
Good work[ Go to top ]
- Posted by: Ganesh Prasad
- Posted on: January 08 2004 18:08 EST
- in response to Dion Almaer
Seems neat. It shouldn't be too hard to support INSERT, DELETE and UPDATE as well with very little effort.
What would be really useful are slightly out-of-the-way features like
INSERT INTO <table>
SELECT ...
i.e., insert based on a selection rather than just a plain INSERT of values,
and
UPDATE <table>
SET <column> = <column> <operator> value
WHERE ...
i.e., update of existing values rather than new values.
Ganesh -
Yet another util libray[ Go to top ]
- Posted by: Linards Kanenbergs
- Posted on: January 09 2004 02:58 EST
- in response to Dion Almaer
Well, there is fate blog about this post :
http://www.jroller.com/page/fate/20040108
Probably most of TSS readers already have their preffered or their own SQL libraries.
Linards -
Actually....[ Go to top ]
- Posted by: Hani Suleiman
- Posted on: January 09 2004 09:10 EST
- in response to Linards Kanenbergs
My post was not about this (I don't know why anyone would think that either!).
This library is small and very focussed on its own core task. This is EXACTLY how all util libs should be. My rant is against generic dumping ground type util libraries where people just put in everything. The stuff that gets released doesn't address any particular problem particularly elegantly, it isn't focussed, you're just expected to take on some crap and use it 'generically' in some magical way.
I wish util libs instead do what this one does, which is stick to one problem domain and address that as best as possible. -
Thanks Hani[ Go to top ]
- Posted by: Linards Kanenbergs
- Posted on: January 09 2004 13:11 EST
- in response to Hani Suleiman
Thanks for clarifying this.
I agree, but I have seen 10+ implementations of this idea. Basically what follows after is that people begin to add stuff, like all DB compatibility, inserts, updates, DB structure alteration, and so on, and the original idea become diluted. Not that these all ideas in ideal implementation would not be useful, they just becomes unnecessary when you reuse library in next project.
Interface usability is dependant on project size. What is good for small things, is not good for big and vice versa.
This library is for small things.
Linards -
just the select?[ Go to top ]
- Posted by: jag huang
- Posted on: January 11 2004 19:39 EST
- in response to Dion Almaer
I have the same idea with you by sql.
I am so grant to see this tool.
but,just the "select"?
how about "update","delete"......?