ysql

0.0.6 • Public • Published

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

Build Status

Package Sidebar

Install

npm i ysql

Weekly Downloads

7

Version

0.0.6

License

ISC

Last publish

Collaborators

  • mitica