VisualQuery

Browser-based report generator with intuitive user interface for constructing simple database queries by end users with no SQL knowledge. It is implemented as a Rails engine, so you can drop it in your application (with caution, continue reading).

Installation

In your Gemfile:

gem 'visual_query'
gem 'jquery-ui-rails'

In your config/routes.rb:

    mount VisualQuery::Engine => "/admin/queries", :as => "visual_query"

You can change the mount point path to whatever you want.

Create config/initializers/visual_query:

    VisualQuery::BaseController = ApplicationController # or whatever controller you want to inherit from
    QueriesController.layout('admin') # optional

Add the following to your application.js:

//= require jquery.ui.datepicker
//= require visual_query

and application.css:

/*
 *= require jquery.ui.datepicker
 */

Word of Caution
===============

VisualQuery is not implemented as an isolated namespace as Rails team suggests. Thus it imports some methods in your helpers which can lead to conflicts in case
you use default Rails behaviour of including them all with `helper :all`. In case it conflicts with some method defined in your helper you can put in `config/application.rb`
`config.action_controller.include_all_helpers = false` and specify for each controller which helpers should be used.

Testing
=======
You need postgresql for testing

```ruby
    rake db:create
    RAILS_ENV=test rake db:schema:load
    rake test