Question

Are there any (good/usable/not ugly) JavaScript/interface libraries for managing the creation of custom boolean style queries, similar to the Google Analytics Advanced Segment interface?

Basically, a dynamic interface for query building that can be used to connect to a custom query builder on the backend (in my case, MySQL, but it needn't be database specific).

I've searched around, and haven't found anything helpful or usable.

Google Analytics Query Builder

Was it helpful?

Solution

A fairly new one is the jQuery QueryBuilder which can be found here: http://querybuilder.js.org/

It supports the following logical and filter operators:

  • and
  • or
  • equal / not equal
  • in / not_in
  • begins with / not begins with
  • contains / not contains
  • ends with / not ends with
  • is empty / is not empty
  • is null / is not null
  • less / less or equal /greater / greater or equal
  • between / not between

The basic output is JSON but plugins for SQL or MongoDB syntax import/export are available too.

Some demos can be found here: http://querybuilder.js.org/demo.html

OTHER TIPS

http://redquerybuilder.appspot.com/ is not pretty but aiming to be usable by non-techy people.

I should make it clear that I'm one of the authors of this project.

I found this question on the Elastic Search forum, that is very similar to yours. An elastic search js client library is suggested : http://elasticsearch-users.115913.n3.nabble.com/javascript-query-builder-td1860558.html .

ExtJS has a Query Builder extension to their Grid control: http://www.developerextensions.com/index.php/extjs-grid-query-builder (look for the link above the table that says Query Builder).

I also found this, "Active Query Builder": http://aspquerybuilder.net/default.aspx The feature list is : http://www.activequerybuilder.com/featurematrix.html?show=asp . It's an paid ASP.NET component that uses jQuery. It's pretty robust and may be more than you are looking for and also may or may not be compatible with your framework (you didn't specify), but it does look pretty cool.

Some more ASP.NET-based query builders are linked from : Web based visual query builder.

Here is web-service I came across recently: Advangle.

Looks like they use a kind of JavaScript library with UI similar to what you requested.

There is also an MS Access like javascript visual sql query builder based on the Sencha ExtJS Framework. http://www.sencha.com/forum/showthread.php?208444-Ext.ux.window.VisualSQLQueryBuilder

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top