Direct database access

Hi

I would like to write an app that makes some use of ActiveRecord for
persisting a few domain objects but also extensive direct database
access for doing things like creating new tables, adding columns /
indexes. Essentially I’m looking to replicate many of the features in a
tool like phpmyadmin for mysql, in a ruby app.

I have two questions:

  1. Is this creating and or modifying of tables, fields, indexes etc
    something I Should do using Ruby DBI? Can ActiveRecord do any of this
    stuff?

  2. If I do need to use DBI is there anywhere I can borrow features from
    ActiveRecord such as getting the database connection from ActiveRecord
    but executing custom SQL against them. Or accessing database tables
    using ActiveRecord which may be renamed or have fields added or removed
    at run time?

My thanks in advance

Adam

Adam Griffiths wrote:

I would like to write an app that makes some use of ActiveRecord for
persisting a few domain objects but also extensive direct database
access for doing things like creating new tables, adding columns /
indexes. Essentially I’m looking to replicate many of the features in a
tool like phpmyadmin for mysql, in a ruby app.

ActiveRecord has some schema editing abilities already due to it’s
migration facility. Take a look at that as much of the differences
between the various database systems have already been abstracted for
you.

Eric