Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby Adapter For Vertica Databases

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 vertica.gemspec
README.textile

Vertica

by Matt Bauer

Description

Vertica is a pure Ruby library for connecting to Vertica databases. You can learn more
about Vertica at http://www.vertica.com. This library currently supports queries and
prepared statements.

Install

$ gem install mattbauer-vertica —source http://gems.github.com

Source

Vertica’s git repo is available on GitHub, which can be browsed at:

http://github.com/mattbauer/vertica

and cloned from:

git://github.com/mattbauer/vertica.git

Usage

Example Query


  c = Vertica::Connection.new(
    :user     => 'user',
    :password => 'password',
    :host     => 'db_server',
    :port     => '5433',
    :database => 'db
  )
  r = c.query("SELECT * FROM my_table")
  puts r.row_count
  puts r.columns[0].name
  puts r.rows
  c.close

Example Prepared Statement


  c = Vertica::Connection.new(
    :user     => 'user',
    :password => 'password',
    :host     => 'db_server',
    :port     => '5433',
    :database => 'db
  )
  c.prepare("my_prepared_statement", "SELECT * FROM my_table WHERE id = ?", 1)
  r = c.execute_prepared("my_prepared_statement", 13)
  puts r.row_count
  puts r.columns[0].name
  puts r.rows
  c.close

Running The Tests

To run the tests, change the values in test_helper.rb to match your db configuration. Then
execute the create_schema.sql on the database. Then you may run the tests.

Something went wrong with that request. Please try again.