Squiggle is a little Java library for dynamically generating SQL SELECT statements. It's sweet spot is for applications that need to build up complicated queries with criteria that changes at runtime. Ordinarily it can be quite painful to figure out how to build this string. Squiggle takes much of this pain away.
The code for Squiggle is intentionally clean and simple. Rather than provide support for every thing you could ever do with SQL, it provides support for the most common situations and allows you to easily modify the source to suit your needs.
Here's a very simple example:
SelectQuery select = new SelectQuery(); Table people = new Table("people"); select.addColumn(people, "firstname"); select.addColumn(people, "lastname"); select.addOrder(people, "age", Order.DESCENDING); System.out.println(select);
SELECT people.firstname , people.lastname FROM people ORDER BY people.age DESC
Now continue with the Tutorial...