-
Notifications
You must be signed in to change notification settings - Fork 659
AST
Mathias Rangel Wulff edited this page Jul 11, 2015
·
1 revision
You can use AlaSQL to parse to AST and compile SQL statements:
// Parse to AST
var ast = alasql.parse("SELECT * FROM one");
console.log(ast.toString()); // Print restored SQL statement
// Compile to JavaScript function with or without parameters
var statement = alasql.compile("SELECT * FROM one WHERE a > ? AND b < ?");
statement([1,5]);
AlaSQL uses wonderful Jison parser to produce AST-tree.
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo