Agile SQL databases and tools for database administrators
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin Refactors the repository to work on a folder instead of the index file. Jul 30, 2010
lib Schema parts ordering is now guaranteed using ruby 1.9 Jan 6, 2011
test Fixed physical databases rake task Jun 15, 2011
.gitignore Ignored eclipse files Jun 15, 2011
CHANGELOG.textile Schema parts ordering is now guaranteed using ruby 1.9 Jan 6, 2011
Gemfile Added a Gemfile to help developers Jun 15, 2011
LICENCE.textile Initial repository and ruby project layout Jun 8, 2010
README.textile Updates what is said in README. Jul 30, 2010
Rakefile Fixed physical databases rake task Jun 15, 2011
TODO.textile Adds some directions for TODO list. Aug 3, 2010
dbagile.gemspec And all tests pass under 1.8.7 Jun 15, 2011


DbAgile – SQL Databases with Agility

DbAgile aims at providing agile tools around databases, and relational/sql databases in particular.


Have you ever dreamed of having one central point for keeping your database access infos?

  sh$ dba db:list
  sh$ dba db:use my_contacts

Or displaying a SQL table (say, ‘contacts’) in one shell command?

  sh$ dba sql:show contacts

Or to output the result of any SQL query to yaml, json, csv, ruby, … or even xml?

  sh$ dba bulk:export --yaml "SELECT name, mail FROM contacts" 

Or to have a Restful server on top of SQL databases?

  dba web:tools

Making similar things, … in Ruby?

  DbAgile::dba do |dba|
    # Override environment default values (~/.dbagile, STDOUT)
    dba.repository_path  = ...      # your application database repository
    dba.output_buffer     = ...     # keep output in any IO object
    # Start using dbagile commands
    dba.bulk_export %w{--yaml contacts}  # each line pushed in output_buffer

The Rack middleware for the restful server (

  #!/usr/bin/env rackup --require dbagile/restful/middleware -p 8711
  app ={|env|
    # Set the environment!
    # WARNING: Always use ::File instead of File because constants are
    #          resolved in Rack scope, which contains a File class. Not
    #          doing this may mead to bugs in certain ruby versions.
    env.repository_path  = ::File.expand_path('../dbagile', __FILE__)


  • DbAgile developper documentation on


  gem install dbagile (required dependencies are automatically installed)
  dba --help

Required dependencies:

  • sbyc >= 0.1.4
  • sequel >= 3.8.0
  • highline >= 1.5.2

Optional dependencies (according to your needs):

  • mysql, pg, sqlite, … (according to your sql database needs)
  • json (only if you use json import/export)
  • fastercsv (only if you use csv import/export)
  • yaml (only if you use yaml import/export)
  • builder (only if you use xml export)
  • rack >= 1.1.0 (only if you use the restful server)


DbAgile © 2010 by Bernard Lambeau and the University of Louvain. DbAgile is distributed under the MIT licence. Please see the LICENCE.textile document for details.