do_postgres

Description

A PostgreSQL driver for DataObjects.

Features/Problems

This driver implements the DataObjects API for the PostgreSQL relational database.

Synopsis

An example of usage:

# default user (postgres, postgres), default port (5432)
DataObjects::Connection.new("postgres://host/database")
# specified user, specified port
DataObjects::Connection.new("postgres://user:pass@host:8888/database")

@connection = DataObjects::Connection.new("postgres://localhost/employees")
@reader = @connection.create_command('SELECT * FROM users').execute_reader
@reader.next!

Requirements

This driver is provided for the following platforms: * Ruby MRI (1.8.6/7), 1.9: tested on Linux, Mac OS X and Windows platforms. * JRuby 1.3.1 + (1.4+ recommended). * Rubinius (experimental).

Additionally you should have the following prerequisites: * data_objects gem * do_jdbc gem (shared library), if running on JRuby.

Install

To install the gem:

gem install do_postgres

To compile and install from source:

For more information, see the PostgreSQL driver wiki page: wiki.github.com/datamapper/do/postgresql.

Developers

Follow the above installation instructions. Additionally, you'll need: * rspec gem for running specs. * YARD gem for generating documentation.

See the DataObjects wiki for more comprehensive information on installing and contributing to the JRuby-variant of this driver: wiki.github.com/datamapper/do/jruby.

To run specs:

rake spec

To run specs without compiling extensions first:

rake spec_no_compile

To run individual specs:

rake spec SPEC=spec/connection_spec.rb

License

This code is licensed under an MIT (X11) License. Please see the accompanying LICENSE file.