百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

nquery

> 编程语言
开源

用于 Web 和大数据的通用 SQL 引擎。

385 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 Web 和大数据的通用 SQL 引擎。

nQuery

Generic SQL engine for Web and Big-data.

Install

NodeJS Version 0.8.0+

bash
npm install node-query

Introduction

it could be used in some typical scenarios:

  • As a SQL frontend, do syntax checking and formating.
  • As a SQL engine for your KV databases like HBase or anything like that.
  • Providing a SQL interface for your HTTP/WEB service.
  • Do data merging and intergration among many different data sources like Oracle, MySQL, HBase etc.

Demo & Test

to run the demo, type the command:

bash
node demo/demo.js

for the test , type the command:

make

read 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.

Usage

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,
  • likeQuery

for a SQL storage engine, you should realize a function like :

javascript
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

nSQL Definition

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.

Task Scheduling

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

KeyWord return

In 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]]

Just Enjoy It!

Acknowledgements

  • PegJS : http://pegjs.majda.cz/
  • NodeJS : http://nodejs.org/
  • BigQuery : https://developers.google.com/bigquery/docs/query-reference
  • PL/SQL : http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/fundamentals.htm#autoId0
  • MySQL : http://dev.mysql.com/doc/refman/5.1/en/sql-syntax.html
  • Impala : https://github.com/cloudera/impala/blob/master/fe/src/main/cup/sql-parser.y
  • PgSQL : http://www.postgresql.org/docs/9.2/interactive/sql-syntax.html
  • ql.io : http://ql.io

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言