Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SQL → Databox with Databox Ruby Gem

How to quickly stream data from PostgreSQL to Databox with Databox Ruby Gem?

databox_demo.gif

Example

This example contains example on how to create PostgreSQL database that will hold OPEC oil prices. When new price is inserted into prices table PostgreSQL triggers NOTIFY and streamer.rb LISTENs and sends data to Databox.

Steps to get you going...

First create new .env in current project folder with your DATABOX_PUSH_TOKEN.

Create new database, start PostgreSQL daemon and setup new database:

initdb db/pg-data -E utf8;
postgres -D db/pg-data
rake db:setup

Start streamer that will LISTEN to inserts and push KPIs to Databox.

./streamer.rb

Open another terminal / session and run following task that will import couple of prices.

rake prices:import

For playing with data you can load IRB session:

irb -r./boot.rb
Price.create date:DateTime.now, volume:100
Price.import Price.all_from_ws

Author

About

SQL to Databox with Databox Ruby Gem

Resources

License

Releases

No releases published

Packages

No packages published