Imparcial, Database Abstraction Layer
by Guilherme Antoniolo Ferreira

== DESCRIPTION:

Imparcial is a Database Abstraction Layer for Ruby. It's designed not only to
be a connection and result-set wrapping, one can also manipulate databases'
mechanisms with ruby structures as well as by using SQL syntaxes.
Furthermore, Imparcial is primarly intented to be a library for developing
ORMs, although one can use it in any application as long as that application
needs an abstraction layer.

== FEATURES/PROBLEMS:

* API may change;

== SUPPORTED DATABASES:

* PostgreSQL
* MySQL

== USAGE:

* Initializing the adapter:

adapter = Imparcial::Initializer.adapter(:mysql) do |config|

config.username = 'batman'
config.password = 'joker_suckz'
config.database = 'batcave'
config.logger = Logger.new(STDERR)

end

adapter.connect

And that's all. You may also specify :port, :host

* Getting Tables from a specific database:
abstract_adapter

adapter.get_tables # => ['person', 'invoice', 'product', 'supplier']

* Creating a Table

adapter.create_table :table_name => 'user', :fields => [=> :id, :type => :integer,
=> :name, :type => :string]

adapter.table_exists? :table_name => 'user' # => true

* Inserting Records

adapter.insert :table_name => 'user', :values => => 1, :name => 'robin'
adapter.insert :table_name => 'user', :values => => 2, :name => 'penguim'

* Deleting Records

adapter.delete :table_name => 'user', :conditions => ['id = ?', 1]

* Selecting Records

adapter.select :table_name => 'user'
adapter.result.each do |id, name|
puts 'displaying info:'
puts "#idid.column_name = #idid.column_value"
puts "#namename.column_name = "#namename.column_value"
end

* Dropping a Table

adapter.drop_table :table_name => 'user'

Make sure to check the API for more features!

== REQUIREMENTS:

* facets
* rake
* hoe

== INSTALL:
Always get the lastest version!

Firstly, install the adapter's specific driver.
* gem install mysql

Secondly, install the dependencies:
* gem install facets
* gem install rake
* gem install hoe

Now, the lib:
* gem install imparcial

== LICENSE:

(The MIT License)

Copyright (c) 2007 Guilherme Antoniolo Ferreira

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.