dbgate/packages/sqltree
2020-11-17 07:48:45 +01:00
..
src renamed dbgate packages, because of npmjs policy 2020-11-16 21:59:08 +01:00
.gitignore introduced sqltree typescript library 2020-03-05 07:35:23 +01:00
package.json npm packages - keywords 2020-11-17 07:48:45 +01:00
README.md renamed dbgate packages, because of npmjs policy 2020-11-16 21:59:08 +01:00
tsconfig.json packages, documentation 2020-03-13 22:42:09 +01:00

dbgate-sqltree

JavaScript/TypeScript SQL query-builder library

dbgate-sqltree hold query definition in RAW JSON objects.

Sample usage

const { treeToSql, dumpSqlSelect } = require('dbgate-sqltree');
const engines = require('dbgate-engines');

const select = {
  commandType: 'select',
  from: { name: 'Album' },
  columns: [
      {
        exprType: 'column',
        columnName: 'name',
      }
  ]
  })),
  orderBy: [
    {
      exprType: 'column',
      columnName: 'id',
      direction: 'ASC',
    },
  ],
};

const sql = treeToSql(engines('mysql'), select, dumpSqlSelect);
console.log('Generated SQL', sqll);

Installation

yarn add dbgate-sqltree