by Matt Bauer
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.
Vertica’s git repo is available on GitHub, which can be browsed at:
http://github.com/mattbauer/verticaand cloned from:
git://github.com/mattbauer/vertica.git
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
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
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.