Project

rel

0.0
No commit activity in last 3 years
No release in over 3 years
Client for the Bandicoot relational algebra database.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme
BANDICOOT(1)

NAME
      rel -- Bandicoot client.

SYNOPSIS
      db = Rel.new(<host>, <port>)
      db.post(<bandicoot_fn_symbol>, <data>)
      db.get(<bandicoot_fn_symbol>)

DESCRIPTION
      Rel is a client library for the Bandicoot relational algebra
      database.

USAGE
      Create a client:

          db = Rel.new

      Rel receives two parameters: host, which defaults to "localhost",
      and port, which defaults to 12345. It will connect via HTTP to send POST
      and GET requests to the server.

      If we have this server side Bandicoot program:

          # cat foo.b
          rel Items {
            id: int,
            pid: int,
            ts: long,
          }

          queue: Items;

          fn push(i: Items) {
            queue += i - queue project(id);
          }

          fn list(): Items {
            return queue;
          }

      Then we can use Rel as follows:

          db.post(:push, some_csv)
          db.get(:list)             #=> Returns an array of results

      It also provides a model-like class for mapping Bandicoot rels:

          class Item < Rel::Model
            field :id, :int
            field :pid, :int
            field :ts, :long
          end

      Now you can do:

          item = Item.new(id: 1, pid: 0, ts: 1310084883)
          db.post(:push, item.to_csv)

INSTALLATION
      $ gem install rel