Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alsotang/sql.pegjs
https://github.com/alsotang/sql.pegjs
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alsotang/sql.pegjs
- Owner: alsotang
- Created: 2014-01-15T04:59:16.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T08:24:50.000Z (over 7 years ago)
- Last Synced: 2024-05-02T01:10:40.688Z (8 months ago)
- Language: JavaScript
- Size: 30.3 KB
- Stars: 23
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sql.pegjs
## THIS PROJECT IS DEPRECATED, PLEASE FORK YOUR OWN
**[WARN]https://github.com/steveyen/sqld3 seems just a toy, so do not use both projects of us.**
This project is a SQL parser based on PEG([parsing expression grammar](http://en.wikipedia.org/wiki/Parsing_expression_grammar)).
And the `sql.pegjs` file is modified from [https://github.com/steveyen/sqld3](https://github.com/steveyen/sqld3).
Thanks for the effort of @steveyen.
## Usage
```js
var parser = require('sql.pegjs');
var sql = 'select * from users;';
parser.parse(sql)
// => [{"stmt":"select","select_cores":[{"results":[{"column":"*"}],"from":[{"table":"users"}]}]}]);```
## How to contribute
1. modify `lib/sql.pegjs` and add tests.
1. run `make build`
1. then run `make test`
## License
MIT