tarsislima / arangodb-php-aql-generator Goto Github PK
View Code? Open in Web Editor NEWAQL Generator For ArangoDb-PHP [Alpha] This is a experimental Aql Query Builder to generate AQL strings.
AQL Generator For ArangoDb-PHP [Alpha] This is a experimental Aql Query Builder to generate AQL strings.
Need implementation for UPDATE and REPLACE statements
FOR u IN users
FILTER u.status == 'not active'
UPDATE u WITH { status: 'inactive' } IN users
There is currently no support for subqueries inside functions because second parameter of LET method expect AqlGen Object to wrap the subquery with parentheses
as for example:
// expected
// FOR l IN locations
// LET users = FIRST( (FOR u IN users) )
$mainQuery = AqlGen::query('l', 'locations');
$users = AqlGen::query('u', 'users');
// next produces
//LET users = (FOR u IN users)
$mainQuery->let('users', $users);
//but for functions only work with string
$mainQuery->let('users', 'FIRST((' . $users->get() .'))');
Some sugestions of implementations?
Need implementation for INSERT and DELETE statements
//insert
FOR u IN users
INSERT u IN backup
//Remove
FOR u IN users
FILTER u.status == 'deleted'
REMOVE u._key IN backup
O posição da chamada sort influencia no resultado de query com subquery. Exemplo:
$q = AqlGen::query('u', 'users')
->sort('u.createdAt', 'ASC')
->subquery(
AqlGen::query('s', 'u.sales')
->filter('s.year == "2014"')
)
->limit(1);
echo $q->__toString();
A query é montada assim:
FOR u IN users
FOR s IN u.sales
FILTER s.year == "2014"
LIMIT 1
SORT u.createdAt ASC
RETURN u
O esperado seria:
FOR u IN users
SORT u.createdAt ASC
FOR s IN u.sales
FILTER s.year == "2014"
LIMIT 1
RETURN u
ou assim:
FOR u IN users
FOR s IN u.sales
FILTER s.year == "2014"
SORT u.createdAt ASC
LIMIT 1
RETURN u
Quando o SORT vem depois do LIMIT, não há o ordenamento esperado.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.