New around here? When you sign up for a new account, please indicate why you want to join on the registration form so we can determine which applications are genuine and which are from spammers.

Once you've signed up, please wait 12 hours or so for your account to be approved.
You must be 16 or over to participate in the Brickset forum. Please read the announcements and rules before you join.

Advanced query builder

edited April 2012 in
I've mentioned that I was working on an 'advanced' means of querying the database in several threads. I now have something to look at and test, although it doesn't actually do any searching yet.

The user interface for creating ad-hoc queries is just about done and I'd like your feedback.

You can create queries and see the resultant SQL that will, eventually, be executed (using a r/o database account, I hasten to add, to prevent SQL injection vulnerabilities)

You can specify queries to do things like

"show me all polybag sets released since 2007 that I don't own, order by year released, then number".
"Show me all sets with between 5 and 10 minifigs, order by number of minifigs, descending"
"Show me all sets in the themes Aquazone and Aquaraiders that cost less than $10, and order by year released"
"Show me all sets with an X in the name that were available from in 2008" (useful, eh!)

that sort of thing, which can't of course be done at the moment.

Not every query will be possible because, to keep things simple, you can't specify how the terms should be bracketed. It assumes that you want OR terms bracketed together which in 95% of cases I believe you will do.

So, what you're testing is the UI for specifying the query and whether the SQL generated is what you're expecting. When that's done, I'll move on to saving and executing the query, then editing and sharing them with others.

There's a couple of things still to do, including providing guidance as to what type of data is valid in the text box (date, number, anything) and date validation.



Sign In or Register to comment.
Recent discussions Categories