https://github.com/1ilit/oracle-sql-parser
Spec compliant SQL parser and AST explorer for Oracle
https://github.com/1ilit/oracle-sql-parser
ast ast-explorer oracle oracle-database parser pegjs
Last synced: about 1 month ago
JSON representation
Spec compliant SQL parser and AST explorer for Oracle
- Host: GitHub
- URL: https://github.com/1ilit/oracle-sql-parser
- Owner: 1ilit
- License: mit
- Created: 2024-09-06T05:40:22.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-19T13:04:14.000Z (about 1 month ago)
- Last Synced: 2025-03-19T14:22:55.139Z (about 1 month ago)
- Topics: ast, ast-explorer, oracle, oracle-database, parser, pegjs
- Language: PEG.js
- Homepage: https://1ilit.github.io/oracle-sql-parser/
- Size: 497 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# oracle-sql-parser
Simple SQL parser and [AST explorer](https://1ilit.github.io/oracle-sql-parser/) for Oracle SQL following the [Oracle Database Language Reference](https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/index.html).
## Usage
#### Install the package:
```sh
npm i oracle-sql-parser
```#### Parse and print:
```js
const { Parser } = require('oracle-sql-parser');const parser = new Parser();
const sql = 'CREATE TABLE users (id integer);';
const ast = parser.parse(sql);console.log(ast);
```## Run locally
```sh
git clone https://github.com/1ilit/oracle-sql-parser.git
cd oracle-sql-parser
npm i
npm test
```## Scripts
Generate the parser in `./build/parser.js`
```sh
npm run generate
```Generate and minify the parser in `./build/parser.js`
```sh
npm run build
```