用于 Web 和大数据的通用 SQL 引擎。
Generic SQL engine for Web and Big-data.
NodeJS Version 0.8.0+
npm install node-queryit could be used in some typical scenarios:
to run the demo, type the command:
node demo/demo.jsfor the test , type the command:
makeread the demo carefully and then you could write own loader/adapter,
there are also many test cases in test/unit, they would be great helpful to you.
please read the demo files demo/demo.js
for a KV storage engine ,what you need to do is providing the query interfaces like:
singleQuery, rangeQuery, likeQueryfor a SQL storage engine, you should realize a function like :
function query(str, function(err, data) {
...
})then you could execute SQL like that : (code snippet from demo.js)
…As you see ,besides as a SQL computation level built on top of KV storage engine, it could do join operation among kv data source, sql sources, HTTP services now
The 'a little strange' sql as you see above, nSQL realize a subset of SQL92, and it
also has some procedure features, it supports variables, it addes types of var
/ array / table, and also keyword return, for the details, please see the
specification of peg/nquery.pgejs.
As you could see in concurrentJoinSQL ,we know that the tasks $a, $b have no
relations, so nQuery would do them concurrently, but for the procedure of sequentialJoinSQL,
$b is depending on $a,so task $b would be executed after the time $a completed
returnIn traditional SQL, the query result is a 2-D table , but In nSQL ,we add types of array
/ table,so now you could return complicated results like
return [$b, $c, 'hello', [1, 2]]暂无开放 Issues,或尚未同步最近议题。