dbgate/packages/sqltree
dependabot[bot] ef25ea1885
Bump lodash from 4.17.15 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-16 12:00:59 +00:00
..
src select page by row_number for MS SQL 2008 #93 2021-04-25 11:48:23 +02:00
.gitignore introduced sqltree typescript library 2020-03-05 07:35:23 +01:00
.yarnrc sqltree readme 2020-11-30 20:13:31 +01:00
package.json Bump lodash from 4.17.15 to 4.17.21 2021-05-16 12:00:59 +00:00
README.md fixed repo links 2021-02-11 10:11:34 +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 dbgatePluginMysql = require("dbgate-plugin-mysql");

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

const sql = treeToSql(dbgatePluginMysql.driver, select, dumpSqlSelect);
console.log("Generated query:", sql);

See TypeScript definitions for complete list of available SQL command options.

Installation

yarn add dbgate-sqltree