caql-decompiler
v0.8.0
Published
Decompiles a CaQL AST into a plaintext query.
Downloads
32
Readme
caql-decompiler
Decompiles a caql AST into a plaintext query.
Install
npm install caql-decompiler
Example
var Parser = require('caql');
var CaqlDecompiler = require('caql-decompiler');
var decompiler = new CaqlDecompiler();
var query = 'select name, founded_year, total_money_raised as worth '
+ 'where founded_year >= 1999 and name not like "%air%" '
+ 'order by founded_year desc, name';
var ast = Parser.parse(query);
var ql = decompiler.decompile(ast);
console.log(ql);
// Output:
//
// select name, founded_year, total_money_raised as worth where
// ( founded_year >= 1999 and name not like "%air%" ) order by founded_year desc, name asc
License
MIT