What is MetaQuerier?

MetaQuerier is a RubyOnRails plugin that is a part of MetaRails. Its aim is to make any kind of query to a database in a RubyOnRails application with zero configuration.

Building a query

MetaQuerier detects the structure of the application models. Shows a diagram of the application and offers a custom form for building queries and browsing its data.

Saving a query

It also permits save and load queries, and parametrice them allowing made conditions fixed or variables.
If you save a query with variable conditions then when you run this query MetaQuerier ask you for the condition value to assign.

Running the query

Shows the result in HTML and permits export it to CSV, text separated by tabs, XML or Excel.

Query result in HTML

Integrates itself with ActAsAuthenticated plugin.

Manages different profiles that can be used to define different zones of the application database. This functionality helps the user defining queries.


Prerequisites: In order to show graphs of the application database structure, MetaQuerier needs Graphviz.

  1. From the rails application root directory:
    script/plugin install 
  2. Reload your server and point your browser to the "/meta_querier" folder of your application, for example:

MetaQuerier looks if you have ActAsAuthenticated plugin installed, if so it calls automatically the function login_required acting as expected.
If you have ActAsAuthenticated plugin installed but you don't want MetaQuerier to use ActAsAuthenticated you must add the next code to config/environment.rb:

MetaQuerierUseActAsAuth = false


Future Features

More information

You can find more information about MetaRails in the rubyforge project page and the next blogs:


If you have played a bit with Ruby you will believe us when we say that we are enjoying a lot developing MetaRails. This project let us dig a lot into RoR and Ruby internals and learn so much.

If you want to enjoy and learn with MetaRails email to sergio.espeja+metarails [youknowwhat] in order to contribute in any way with the project.


Project created by Sergio Espeja as part of his work in Institut Universitari de Lingüística Aplicada of Universitat Pompeu Fabra and in

The development of this project is being done by Sergio Espeja with the collaboration of Jorge L. Cangas.

MetaRails uses SQL DSL library developed mainly by Jay Fields. Inspiration for database diagram generation comes from Rails Application Visualizer project.

MetaRails is released under GPL License.
Rails is released under the MIT license.
Ruby under the Ruby License.