The purpose AQL is to be able to turn this:
table { field1, field2, field3 }
into
SELECT table.field1, table.field2, table.field3 FROM table;
or, with a variance of a restraint that will be configurable.
SELECT table.field1, table.field2, table.field3 FROM table WHERE table.active = 1;
Using this as a Parser Generator to replicate and improve upon AQL.
In git directory, run:
$ ./pacc -i src/aql.y -o lib/AQL/Parser.php -f
- Add tests
- Make actual SQL out of the AQL. (although this ends up being fairly trivial)
- Enable a DB adapter so joins can be constructed automatically using foreign keys.
- Allow for optional table constraints (
active = 1
) - Infinite Recursion for inner queries, and possibly subqueries, the current version does not support subqueries.
- Fix how the tokens are actually made (currently just
stdClass
with two properties).