Never Publish Malarkey

    dbgate-sqltree
    TypeScript icon, indicating that this package has built-in type declarations

    5.0.6 • Public • Published

    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
    

    Install

    npm i dbgate-sqltree

    Homepage

    dbgate.org/

    DownloadsWeekly Downloads

    143

    Version

    5.0.6

    License

    MIT

    Unpacked Size

    24.1 kB

    Total Files

    20

    Last publish

    Collaborators

    • jan.prochazka