Giter Club home page Giter Club logo

arangodb-php-aql-generator's People

Contributors

tarsislima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

olaria govaniso

arangodb-php-aql-generator's Issues

'Update' statement support

Need implementation for UPDATE and REPLACE statements

FOR u IN users
  FILTER u.status == 'not active'
  UPDATE u WITH { status: 'inactive' } IN users

Support to AQL functions involving subquerys

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?

'Insert' and 'Remove' statements support

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

Comportamento do SORT

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.