ysql
v0.0.6
Published
JSON/YAML to SQL convertor
Downloads
42
Maintainers
Readme
YSQL
YSQL is a language based on YAML or JSON that converts to SQL.
Usage
var Query = require('ysql').Query;
var query = new Query();
var ysql = fs.readFileSync('format.yml', 'utf8');
query.parse(ysql).toSql();
// output: { text: 'SELECT id, name AS "title" FROM "docs"', params: [] }
Where file format.yml
content is:
SELECT:
COLUMNS:
- COLUMN:
name: id
- COLUMN:
name: name
as: title
FROM:
TABLE:
name: docs