Skip to content

soveran/rel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby client for the Bandicoot database.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages