Giter VIP home page Giter VIP logo

ql.io's Introduction

ql.io

ql.io is a declarative, data-retrieval and aggregation gateway for quickly consuming HTTP APIs. See ql.io for docs, demos and examples.

Travis status

How to Build ql.io

To build ql.io on your own, you need node (version 0.8.0 or later) and npm. In Ubuntu, you need libexpat-dev additionally. Once you have these set up, do the following:

git clone git://github.com/ql-io/ql.io.git
cd ql.io
make install

Note If you get "ERR! Error: EACCES, Permission denied" errors, please take a look at npm issue #194 and what-no-sudo.

These steps will link ql.io modules locally so can you refer to those modules from your apps using npm link.

To run tests

make test 

ql.io source is organized into several modules that you can test independently.

cd modules/engine
make test

Using ql.io as a Stand-Alone Server

If you are interested in using ql.io as a stand-alone server, setup a new ql.io app and start the server.

mkdir myapp
cd myapp
curl https://raw.github.com/ql-io/ql.io/master/modules/template/init.sh | bash
bin/start.sh

Using latest versions of Firefox or Chrome, go to http://localhost:3000 to see ql.io's Web Console. See the Quickstart Guide for more details.

Using ql.io in a Node App

If you are interested in using ql.io in your node app, use

npm install ql.io-engine

After that you can simply execute the core engine.

var Engine = require('ql.io-engine');
var engine = new Engine({
    connection: 'close'
});

var script = "create table geocoder " +
             "  on select get from 'http://maps.googleapis.com/maps/api/geocode/json?address={address}&sensor=true' " +
             "     resultset 'results.geometry.location'" +
             "select lat as lattitude, lng as longitude from geocoder where address='Mt. Everest'";

engine.execute(script, function(emitter) {
    emitter.on('end', function(err, res) {
        console.log(res.body[0]);
    });
});

Making Contributions

Fixes and features via pull requests are welcome as long as the contributor agrees to the Contributor License Agreement. Print, sign, and email a scanned copy to subbu/AT/ebaysf/DOT/com before submitting the first pull request.

To help move pull requests quickly, consider socializing your idea in the email group.

Discussions

Subscribe to the google group.

ql.io's People

Contributors

arekatla avatar hochang avatar idralyuk avatar mtipnis avatar prabhakhar avatar s3u avatar shimonchayim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ql.io's Issues

count?

How do I know the number of results returned?

in should allow numbers

While

select * from foo where id = 1234

is possible,

select * from foo where in in (1234, 3456)

is not. But

select * from foo where in in ('1234', '3456')

is possible.

Upgrade to node >=0.6

Potential things to watch out

  • Incompatibilities in modules?
  • Cluster?
  • Mon module may need significant tweaks

Assoc array style hashing

This is an idea from Juan.

items1 = select item from foos;
items2 = select item from bars;

Here items1 and items2 are objects with some common fields. Assume that these items have a unique key. The idea is provide a join between these two and hash the response using that key so that the joined response might look like

{
  "key1": {...},
  "key2": {...},
  "key3": {...}.
  ...
}

Limit clause

In some cases, we might be interested in getting only the first X results returned by a query. For instance, if we have an API that might return many items that match a given search criteria, we could use a limit clause to get the first 5 of them, like this:

items = select Item from itemAPI where {some condition} limit 5

Additionally, this could also be used to implement pagination for those APIs that support such feature.

items = select Item from itemAPI where {some condition} limit 5, 5

would return the items 5 to 10 from the original response

Something very similar to MySQL's LIMIT syntax (http://dev.mysql.com/doc/refman/5.0/es/select.html):

[LIMIT {[offset,] row_count | row_count OFFSET offset}]

Document that table names in from clause must be in the order of dependencies in case of join statements

For instance,

select e.Title as title, e.ItemID as id, g.geometry.location as latlng, e.Location as loc from ebay.shopping.item as e, google.geocode as g where 
  e.itemId in (select itemId from ebay.finding.items where keywords = 'mini') 
 and e.Location = g.address

is valid while

select e.Title as title, e.ItemID as id, g.geometry.location as latlng, e.Location as loc 
     from google.geocode as g, ebay.shopping.item as e where 
      e.itemId in (select itemId from ebay.finding.items where keywords = 'mini') 
     and e.Location = g.address

is not.

WebSocket + Polling

return {
...
} via route '/foo' using method blah every 10 min;

The client can then make a WebSocket connection and let ql.io do the polling. We may need to add support functions/events/expressions in the language to support this.

support local filtering

In the SELECT where clause, if a field is not part of a web service input parameter, can ql.io perform local filtering of the response based on the where clause.

Joins with column names fail

Consider this example

select e.Title as title, e.ItemID as id, g.geometry.location as latlng, e.Location as loc from ebay.shopping.item as e,     
    google.geocode as g where 
    e.itemId in (select itemId from ebay.finding.items where keywords = 'mini') 
   and e.Location = g.address

This does rubbish results as the joiner part of the statement sends an undefined location to google.geocode. In other cases, the result set will be empty as the joiner would find no data.

On the otherhand, the same statement without aliases works fine

select e.Title, e.ItemID, g.geometry.location, e.Location from ebay.shopping.item as e,     
    google.geocode as g where 
    e.itemId in (select itemId from ebay.finding.items where keywords = 'mini') 
   and e.Location = g.address

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.