{"_id":"node-query","_rev":"61-936a767ee1ef3b3c42ff3899770b3ff5","name":"node-query","description":"general sql query interface for hybrid data sources","dist-tags":{"latest":"0.3.3"},"versions":{"0.1.0":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.0","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.0","dist":{"shasum":"bbcab69fcd37b85c3338fe4ff68f662d69199ab2","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.0.tgz","integrity":"sha512-+P8U7lqNqeohIJK3kDtiS7bzNcblZa4QflujvIXOgI/GqZeCMmqAT3nabK0BjcuP9gsZw6wG4oy7DSaqPBFVZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw6UVwuyI1/BHIXORd0y+u1WZYI9bQmVE9JLXYT1Q/8wIhAO0kmCavmbNoa7ET05dTOCiR7pTfQw36fZlxdNL8pu3n"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.1":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.1","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.1","dist":{"shasum":"d8332501c9cdb685a3ddf1a9d02934f28dbbaaf4","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.1.tgz","integrity":"sha512-QnUyd6OzaolIs1OLd9IvzgUtt+PDaZYLDEQPg03mUreKjM+S2sKgfOMc8pXFTkqtrrtrecHpKUh8t+RF0rJIgQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtXZCye1mzkLAiM3iQORfq+xZXMH58OEajGFt6S+3bDAiEAmPGkXmjFfFKrYzjK9gJg/AHyovPkjZDup5wlKXeHCo0="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.2":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.2","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.2","dist":{"shasum":"1835c44da78bfe4ae51c044ccd10b670a3a100ff","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.2.tgz","integrity":"sha512-pJPrew7Zkw5HeAywd69qpTXYMOoUQuXyeNgEvfoYXFJUmwD+9jgiyT7QgeiH2Sw2AFzUZppJUivG6bEe1/iCKA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1JshMIC3IFizS6wIXHTFRyjqmkceAh5Ct1kLpsPtzwQIhAN1HIKxiY2tmBis1zuFOGm4/JynqLajGZiwt8DZ/8A3B"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.3":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.3","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.3","dist":{"shasum":"1435b5c33c76cf794f837cc749845f7e2c887a04","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.3.tgz","integrity":"sha512-OdKDWTod3kuaraE4vyd9xTXRLMkCDkMGywSPqku/IyyuhnHXDHPZcbOooTK6t9nXPJRrquXCdhFvSTBOWtt79A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDllKG3pqm8JydKPd/gC8fygWfPjxQRH4vY8h9GyQB1wwIhAKIvvAOfyyopO+ijQB9iihKZs4LXpZVAdINJY3ZvG3md"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.4":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.4","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.4","dist":{"shasum":"3399ff8bab8c9a949239867501accc33ec5a500e","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.4.tgz","integrity":"sha512-dD6VIrxOzDNO1Eczc5CH1/XXhHfRinZqXemVGm9x6laLSP+8bl4dQPWe6gUmpo14CUCTSK3/Py3aPUOuFdtdyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8QBswMGQHC/ncwYD63UfLmr1UT85GA6d+PLPOb1ohUwIgLadguEplL/6rrrI7MFqTV5a/BTX+AX35dIYWaGglcAA="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.5":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.5","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.5","dist":{"shasum":"fea53db58a71b573faff351c71d879c786991513","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.5.tgz","integrity":"sha512-oudBgcl+gCZuyDTmwEZ4nBWc3O3STec7HQ0XnW8gYbTOZCvobfv6JDAHb15LRLJM0csF1XBsv7xdF14QtJqwBg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeoqBoXY+Jtu2/abr2YkIvvpqReGia5X0bcMwiiBbBQAIgfPGIq1v6PA9MVogKzlQzGLZ9UKU1hHkYiVp4LDjnrvc="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.6":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.6","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.6","dist":{"shasum":"8ee36faf0a8043c39468a6f9997ce98e221f58d4","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.6.tgz","integrity":"sha512-MO33dR41WGxg8Yn0QEfIYM51A4YEwpPNONP6TOr+J1XYfGUR2jOgJCUYj1OzGVOZcAdDZdOxwIABdyeHKi+EyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtasCk6vfRlBsYxYzs0zxUZgkPDoTPYiv1FwnROVOVGgIhAN/5/IHlM+/rqxXPz9mf1KhDvP8Y3EwfA6TQsv/cRRSJ"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.8":{"author":{"name":"windyrobin"},"name":"node-query","description":"general sql query interface for hybrid data sources","version":"0.1.8","repository":{"url":"git://github.com/windyrobin/nquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.8","dist":{"shasum":"cb9b329784890a0e7a9e399ad76933e1bcb0c095","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.8.tgz","integrity":"sha512-syS2Jlnra1jLn6r6y5BpF9CDx41naGtFSYfGN9la7dYhPigatLg+M6m7ddZWrfUgGZwgnya1GRu6KUx5SWCL5w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGbptckBvmEQemOIBtZB2sYQ81VjOEAzNuWrCtS/Tmr0AiEAlZE1aKFTV+XIJ0j2d2XGTSEhbSAKJ140yl773xmFM+I="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.1.7":{"author":{"name":"windyrobin"},"name":"node-query","description":"multi sql query interface for hybrid data sources","version":"0.1.7","repository":{"url":"git://github.com/windyrobin/mquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{"pegjs":">=0.7.0"},"devDependencies":{"mocha":">=1.0.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"BSD","readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","_id":"node-query@0.1.7","dist":{"shasum":"1acdacc9329068f0d7d76fe20c22a0c4c2ef6c72","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.1.7.tgz","integrity":"sha512-7+CmVY+BzQ6QSOAMz50eLlyCAxKgvL29QfK250Lf7lF52riOGc3fgJYJBmvyaUGbsDpZGNpe1CeA8mAQGnLEMg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdgFxc+BoGpwxSUh6QP4ye+MEBPfX49pneDVGRvXc+DwIgfYZ0K4PmS7Q000GH+vhTkUwcKyMMBSUZ2CeWrmPQ13s="}]},"_from":"node-query@=0.1.6","_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.3.0":{"author":{"name":"windyrobin"},"name":"node-query","description":"general sql query interface for hybrid data sources","version":"0.3.0","repository":{"url":"git://github.com/alibaba/nquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{},"devDependencies":{"pegjs":">=0.7.0","mocha":">=1.0.0","should":">=1.2.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"GPLv2","readme":"## ![logo](http://nquery.org/images/robin-small.jpg) nQuery  \n\nGeneric SQL engine for Web and Big-data.\n\n## Install\n\nNodeJS Version 0.8.0+\n\n```\nnpm install node-query\n```\n\n## Introduction\n\nit could be used in some typical scenarios: \n  * As a SQL frontend, do syntax checking and formating.\n  * As a SQL engine for your KV databases like hbase or anything like that.\n  * Providing a SQL interface for your HTTP/WEB service.\n  * Do data merging and intergration among many differecnt data sources like Oracle, MySQL, HBase etc. \n\n\n##  Demo & Test\nto run the demo, type the command:\n\n```\nnode demo/demo.js\n```\nfor the test , type the command:\n\n```\nmake\n```\n\nread the demo carefully and then you could write own loader/adapter, \nthere are also many test cases in `test/unit`, they would be great heleful to you.\n\n\n## Usage\n\nplease read the demo files `demo/demo.js`\n\nfor a KV storage engine ,what you need to do is providing the query interfaces like:\n\n  * `singleQuery`, \n  * `rangeQuery`, \n  * `likeQuery`\n\nfor a SQL storage engine, you should realize a function like : \n\n```js\nfunction query(str, function(err, data) {\n  ...  \n})\n```\n\nthen you could execute SQL like that : (code snippet  from `demo.js`)\n\n```js\nvar sqls = [\n  \"SELECT * FROM kv.user WHERE id IN ('01', '03')\",\n  \"SELECT * FROM kv.user WHERE id LIKE '1%'\",\n  \"SELECT type, MAX(age), COUNT(id) FROM kv.user WHERE id BETWEEN '03' AND '10' GROUP BY type ORDER BY MAX(age) DESC\",\n  \"SELECT * from mysql.shop where shop_id > 5\"\n]\n\nvar concurrentJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  \"$b := select * from mysql.shop where shop_id > 5\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return $c\"\n]\n\nvar sequentialJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  //you could also use `unique` do filter firstly\n  //\"$type := UNIQUE($a.type)\",\n  //\"$b := select * from mysql.shop where type = $type\",\n  \"$b := select * from mysql.shop where type in $a.type\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return [$b, $c]\"\n]\n```\n\nAs you see ,besides as a SQL computation level built on top of KV storage engine, it could do\njoin operation among kv data source, sql sources, HTTP services now\n\n## nSQL Definition\n\nThe 'a little strange' sql as you see above, nSQL realize a subset of SQL92, and it \nalso has some procedure features, it supports variables,  it addes types of `var` \n/ `array` / `table`, and also keyword `return`,  for the details, please see the \nspecification of `peg/nquery.pgejs`.  \n\n\n## Task Scheduling\n\nAs you could see in `concurrentJoinSQL` ,we know that the tasks `$a`, `$b` have no \nrelations, so nQuery would do them concurrently,  but for the procedure of `sequentialJoinSQL`,\n`$b` is depending on `$a`,so task `$b` would be executed after the time `$a` completed \n\n## KeyWord `return` \n\nIn traditional SQL, the query result is a 2-D table , but In nSQL ,we add types of  `array`\n/ `table`,so now you could return complicated results like \n\n```\nreturn [$b, $c, 'hello', [1, 2]]\n```\n\n\n###Just Enjoy It!\n\n\n### Acknowledgements\n\n* PegJS     : http://pegjs.majda.cz/ \n* NodeJS    : http://nodejs.org/ \n* BigQuery  : https://developers.google.com/bigquery/docs/query-reference \n* PL/SQL    : http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/fundamentals.htm#autoId0 \n* MySQL     : http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html \n* Impala    : https://github.com/cloudera/impala/blob/master/fe/src/main/cup/sql-parser.y \n* PgSQL     : http://www.postgresql.org/docs/9.2/interactive/sql-syntax.html \n* ql.io     : http://ql.io\n\n","_id":"node-query@0.3.0","dist":{"shasum":"6f2353cb74e1933d25d6335bab6df584adc3059d","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.3.0.tgz","integrity":"sha512-G2OcdbevRKqsFGe1ZUAnyqsOpgVqCrL/zclAgTdHR/W9SuvWQkjCu2CYYpIsft0Y+F7nQpXylsldP+1jkuTXwA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4kdMaUUcNgj03B5rh2KCt7XXcCKAhFmmeOV13neq5CAiEAr8WTgE2H8XVs5fKcAxjV8horRNeK8SULSG466Vs9esA="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.3.1":{"author":{"name":"windyrobin"},"name":"node-query","description":"general sql query interface for hybrid data sources","version":"0.3.1","repository":{"url":"git://github.com/alibaba/nquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{},"devDependencies":{"pegjs":">=0.7.0","mocha":">=1.0.0","should":">=1.2.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"GPLv2","readme":"## ![logo](http://nquery.org/images/robin-small.jpg) nQuery  \n\nGeneric SQL engine for Web and Big-data.\n\n## Install\n\nNodeJS Version 0.8.0+\n\n```\nnpm install node-query\n```\n\n## Introduction\n\nit could be used in some typical scenarios: \n  * As a SQL frontend, do syntax checking and formating.\n  * As a SQL engine for your KV databases like hbase or anything like that.\n  * Providing a SQL interface for your HTTP/WEB service.\n  * Do data merging and intergration among many differecnt data sources like Oracle, MySQL, HBase etc. \n\n\n##  Demo & Test\nto run the demo, type the command:\n\n```\nnode demo/demo.js\n```\nfor the test , type the command:\n\n```\nmake\n```\n\nread the demo carefully and then you could write own loader/adapter, \nthere are also many test cases in `test/unit`, they would be great heleful to you.\n\n\n## Usage\n\nplease read the demo files `demo/demo.js`\n\nfor a KV storage engine ,what you need to do is providing the query interfaces like:\n\n  * `singleQuery`, \n  * `rangeQuery`, \n  * `likeQuery`\n\nfor a SQL storage engine, you should realize a function like : \n\n```js\nfunction query(str, function(err, data) {\n  ...  \n})\n```\n\nthen you could execute SQL like that : (code snippet  from `demo.js`)\n\n```js\nvar sqls = [\n  \"SELECT * FROM kv.user WHERE id IN ('01', '03')\",\n  \"SELECT * FROM kv.user WHERE id LIKE '1%'\",\n  \"SELECT type, MAX(age), COUNT(id) FROM kv.user WHERE id BETWEEN '03' AND '10' GROUP BY type ORDER BY MAX(age) DESC\",\n  \"SELECT * from mysql.shop where shop_id > 5\"\n]\n\nvar concurrentJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  \"$b := select * from mysql.shop where shop_id > 5\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return $c\"\n]\n\nvar sequentialJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  //you could also use `unique` do filter firstly\n  //\"$type := UNIQUE($a.type)\",\n  //\"$b := select * from mysql.shop where type = $type\",\n  \"$b := select * from mysql.shop where type in $a.type\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return [$b, $c]\"\n]\n```\n\nAs you see ,besides as a SQL computation level built on top of KV storage engine, it could do\njoin operation among kv data source, sql sources, HTTP services now\n\n## nSQL Definition\n\nThe 'a little strange' sql as you see above, nSQL realize a subset of SQL92, and it \nalso has some procedure features, it supports variables,  it addes types of `var` \n/ `array` / `table`, and also keyword `return`,  for the details, please see the \nspecification of `peg/nquery.pgejs`.  \n\n\n## Task Scheduling\n\nAs you could see in `concurrentJoinSQL` ,we know that the tasks `$a`, `$b` have no \nrelations, so nQuery would do them concurrently,  but for the procedure of `sequentialJoinSQL`,\n`$b` is depending on `$a`,so task `$b` would be executed after the time `$a` completed \n\n## KeyWord `return` \n\nIn traditional SQL, the query result is a 2-D table , but In nSQL ,we add types of  `array`\n/ `table`,so now you could return complicated results like \n\n```\nreturn [$b, $c, 'hello', [1, 2]]\n```\n\n\n###Just Enjoy It!\n\n\n### Acknowledgements\n\n* PegJS     : http://pegjs.majda.cz/ \n* NodeJS    : http://nodejs.org/ \n* BigQuery  : https://developers.google.com/bigquery/docs/query-reference \n* PL/SQL    : http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/fundamentals.htm#autoId0 \n* MySQL     : http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html \n* Impala    : https://github.com/cloudera/impala/blob/master/fe/src/main/cup/sql-parser.y \n* PgSQL     : http://www.postgresql.org/docs/9.2/interactive/sql-syntax.html \n* ql.io     : http://ql.io\n\n","_id":"node-query@0.3.1","dist":{"shasum":"d452870a08c30b84602ba18fb3efd8bae4271088","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.3.1.tgz","integrity":"sha512-bfdkgnrN9gMFmgV+mFifuURb+PLvOcy7Xt8fIIzEtscDf/H80NDXE7eDcenznYLqFkYl9EzFtY+ybhZ5XMuyXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+DdxBXICSruW34RNJFsq4uz/LdzMKj7e9mXtXHK9ltAiA07YOX6of+6H3ZpwXtd6FIyYG+QuYAjvISOXXUwFolBQ=="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.3.2":{"author":{"name":"windyrobin"},"name":"node-query","description":"general sql query interface for hybrid data sources","version":"0.3.2","repository":{"url":"git://github.com/alibaba/nquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{},"devDependencies":{"pegjs":">=0.7.0","mocha":">=1.0.0","should":">=1.2.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"GPLv2","readme":"## ![logo](http://nquery.org/images/robin-small.jpg) nQuery  \n\nGeneric SQL engine for Web and Big-data.\n\n## Install\n\nNodeJS Version 0.8.0+\n\n```\nnpm install node-query\n```\n\n## Introduction\n\nit could be used in some typical scenarios: \n  * As a SQL frontend, do syntax checking and formating.\n  * As a SQL engine for your KV databases like hbase or anything like that.\n  * Providing a SQL interface for your HTTP/WEB service.\n  * Do data merging and intergration among many differecnt data sources like Oracle, MySQL, HBase etc. \n\n\n##  Demo & Test\nto run the demo, type the command:\n\n```\nnode demo/demo.js\n```\nfor the test , type the command:\n\n```\nmake\n```\n\nread the demo carefully and then you could write own loader/adapter, \nthere are also many test cases in `test/unit`, they would be great heleful to you.\n\n\n## Usage\n\nplease read the demo files `demo/demo.js`\n\nfor a KV storage engine ,what you need to do is providing the query interfaces like:\n\n  * `singleQuery`, \n  * `rangeQuery`, \n  * `likeQuery`\n\nfor a SQL storage engine, you should realize a function like : \n\n```js\nfunction query(str, function(err, data) {\n  ...  \n})\n```\n\nthen you could execute SQL like that : (code snippet  from `demo.js`)\n\n```js\nvar sqls = [\n  \"SELECT * FROM kv.user WHERE id IN ('01', '03')\",\n  \"SELECT * FROM kv.user WHERE id LIKE '1%'\",\n  \"SELECT type, MAX(age), COUNT(id) FROM kv.user WHERE id BETWEEN '03' AND '10' GROUP BY type ORDER BY MAX(age) DESC\",\n  \"SELECT * from mysql.shop where shop_id > 5\"\n]\n\nvar concurrentJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  \"$b := select * from mysql.shop where shop_id > 5\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return $c\"\n]\n\nvar sequentialJoinSQL = [\n  \"$a := select * from kv.user where id BETWEEN '03' and '10'\",\n  //you could also use `unique` do filter firstly\n  //\"$type := UNIQUE($a.type)\",\n  //\"$b := select * from mysql.shop where type = $type\",\n  \"$b := select * from mysql.shop where type in $a.type\",\n  \"$c := select a.type , a.id ,b.name, b.title from $a INNER JOIN $b ON a.type = b.type WHERE a.id > '04'\",\n  \"return [$b, $c]\"\n]\n```\n\nAs you see ,besides as a SQL computation level built on top of KV storage engine, it could do\njoin operation among kv data source, sql sources, HTTP services now\n\n## nSQL Definition\n\nThe 'a little strange' sql as you see above, nSQL realize a subset of SQL92, and it \nalso has some procedure features, it supports variables,  it addes types of `var` \n/ `array` / `table`, and also keyword `return`,  for the details, please see the \nspecification of `peg/nquery.pgejs`.  \n\n\n## Task Scheduling\n\nAs you could see in `concurrentJoinSQL` ,we know that the tasks `$a`, `$b` have no \nrelations, so nQuery would do them concurrently,  but for the procedure of `sequentialJoinSQL`,\n`$b` is depending on `$a`,so task `$b` would be executed after the time `$a` completed \n\n## KeyWord `return` \n\nIn traditional SQL, the query result is a 2-D table , but In nSQL ,we add types of  `array`\n/ `table`,so now you could return complicated results like \n\n```\nreturn [$b, $c, 'hello', [1, 2]]\n```\n\n\n###Just Enjoy It!\n\n\n### Acknowledgements\n\n* PegJS     : http://pegjs.majda.cz/ \n* NodeJS    : http://nodejs.org/ \n* BigQuery  : https://developers.google.com/bigquery/docs/query-reference \n* PL/SQL    : http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/fundamentals.htm#autoId0 \n* MySQL     : http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html \n* Impala    : https://github.com/cloudera/impala/blob/master/fe/src/main/cup/sql-parser.y \n* PgSQL     : http://www.postgresql.org/docs/9.2/interactive/sql-syntax.html \n* ql.io     : http://ql.io\n\n","_id":"node-query@0.3.2","dist":{"shasum":"05940608dde4cb9349562c21bff576f9dd18a35a","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.3.2.tgz","integrity":"sha512-X0Cb3eNDATWMt1EnPII2h+QpxflIu9M3oH/2ECLu6gt/wgZTMJyuSR3YwuypfC7bD/mJc+600ssT4IdczsFfEA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICLxMi2yLiLlxcqP9RAyDCkaOWWYuxHjEbgIoln87XjlAiEAqQAV3nuLHkbTK6WWGazi+7r1ur/MN2s2FArqKdi7Afw="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]},"0.3.3":{"author":{"name":"windyrobin"},"name":"node-query","description":"general sql query interface for hybrid data sources","version":"0.3.3","repository":{"url":"git://github.com/alibaba/nquery.git"},"scripts":{"test":"make test"},"engines":{"node":">=0.8.0"},"dependencies":{},"devDependencies":{"pegjs":">=0.7.0","mocha":">=1.0.0","should":">=1.2.0"},"readmeFilename":"README.md","main":"index.js","directories":{"test":"test"},"keywords":["SQL","Engine","Hybird","Data","Source"],"license":"GPLv2","_npmUser":{"name":"windyrobin","email":"windyrobin@Gmail.com"},"_id":"node-query@0.3.3","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.8.14","_defaultsLoaded":true,"dist":{"shasum":"b3e3d757fef2e2801d52cd3d4798a455f01ae4ab","tarball":"https://registry.npmjs.org/node-query/-/node-query-0.3.3.tgz","integrity":"sha512-NKXnZiK5lAtrfwFroq4DasBteS/5zMbLjb+WT6CpKbDnO+usFNiYj663rL7bwGa+xD3pc99MOltK1h1Ur8qJFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEa+Ba0+Q4njf1fmPf8E/8ytA3G7RbDkXCB8+/aF0r2pAiAWTKF3Y078d4sPUnZvJHgK4TxpVjNq4V+NnO3/x6YsdQ=="}]},"maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}]}},"readme":"mquery\n======\n\nmultiple query interface for data source(mysql, ots, hbase, pgsql, http, ...)","maintainers":[{"name":"windyrobin","email":"windyrobin@Gmail.com"}],"time":{"modified":"2022-06-21T18:30:46.602Z","created":"2013-01-09T07:55:44.757Z","0.1.0":"2013-01-09T07:55:48.389Z","0.1.1":"2013-01-10T06:25:50.717Z","0.1.2":"2013-01-10T09:08:18.538Z","0.1.3":"2013-01-10T12:23:36.026Z","0.1.4":"2013-01-11T02:05:41.548Z","0.1.5":"2013-01-11T07:35:28.452Z","0.1.6":"2013-01-14T14:36:19.974Z","0.1.8":"2013-01-15T07:36:23.553Z","0.3.0":"2013-04-02T03:20:19.446Z","0.1.7":"2013-04-02T03:18:52.053Z","0.3.1":"2013-04-15T03:11:03.800Z","0.3.2":"2013-04-15T09:20:03.631Z","0.3.3":"2013-04-17T02:22:43.878Z"},"author":{"name":"windyrobin"},"repository":{"url":"git://github.com/alibaba/nquery.git"}}