caql-decompiler

Decompiles a CaQL AST into a plaintext query.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
caql-decompiler
0.8.08 years ago8 years agoMinified + gzip package size for caql-decompiler in KB

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