Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robinblomberg/sqlite-compiler
Well-tested SQLite compiler that covers the entire SQLite specification.
https://github.com/robinblomberg/sqlite-compiler
sqlite
Last synced: 1 day ago
JSON representation
Well-tested SQLite compiler that covers the entire SQLite specification.
- Host: GitHub
- URL: https://github.com/robinblomberg/sqlite-compiler
- Owner: RobinBlomberg
- Created: 2020-12-19T07:38:18.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T10:02:51.000Z (about 1 year ago)
- Last Synced: 2024-04-15T00:17:20.823Z (9 months ago)
- Topics: sqlite
- Language: JavaScript
- Homepage:
- Size: 827 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SQLite compiler
A library for compiling SQLite AST nodes into SQLite.
## Installation
```sh
npm install @robinblomberg/sqlite-compiler
```## Usage
```js
import { Nodes } from '@robinblomberg/sqlite-ast';
import { compile } from '@robinblomberg/sqlite-compiler';compile(
Nodes.SelectStmt(
null,
[
Nodes._SelectClause(
null,
[Nodes.ResultColumn(Nodes._Identifier('result-column'))],
[
Nodes._TableQueryClause([
Nodes._TableSelectClause(
Nodes.SelectStmt(
null,
[
Nodes._SelectClause(
null,
[Nodes.ResultColumn(Nodes._NumericLiteral(1))],
[],
null,
null,
[],
),
],
null,
),
null,
),
Nodes.QualifiedTableName(
Nodes._Identifier('table-name'),
Nodes._Identifier('table-alias'),
null,
),
]),
],
null,
null,
[],
),
],
null,
),
);
// 'SELECT result-column FROM ((SELECT 1), table-name AS table-alias)'
```