Skip to content

ifad/ruote-postgres

Repository files navigation

ruote-postgres

Postgres storage implementation for ruote >= 2.2.0

usage

This is how a ruote engine is setup with a ruote-postgres storage and a worker :

require 'rubygems'
require 'json'
require 'ruote'
require 'ruote-postgres' # gem install ruote-postgres

pg = PG.connect(dbname: "foobars", user: "foo", password: "bars")

engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::Postgres::Storage.new(pg)))

To create the table in the database :

Ruote::Postgres.create_table(pg, true)

Tested with pg 0.14.1.

A single 'documents' table is used. To change this name :

opts = { 'table_name' => 'ruote_docs' }

engine = Ruote::Engine.new(
  Ruote::Worker.new(
    Ruote::Postgres::Storage.new(pg, opts)))

running tests

Configure the database connection in spec/config/database.yml

Install required gems using bundler

$ bundle install

Run the tests

$ bundle exec rspec spec/unit/*_spec.rb

license

MIT

links

http://github.com/ifad/ruote-postgres

developers

IFAD - ICT

Lleir Borras http://github.com/lleirborras

Amedeo Paglione http://github.com/amedeo

Emili Parreno http://github.com/eparreno

Peter Brindisi http://github.com/npj

Marcello Barnaba http://github.com/vjt

About

Ruote Storage driver for PostgreSQL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages