Vinelab / NeoEloquent

The Neo4j OGM for Laravel
MIT License
633 stars 197 forks source link

Migrate to official Graphaware php client #333

Closed KinaneD closed 3 years ago

KinaneD commented 4 years ago

*WIP

Neo4j Client Migration

NeoEloquent 1.5-dev

NeoEloquent process

createWith

  1. Model::createWith()
  2. Eloquent/Builder::createWith()
  3. Query/Builder::createWith() -> $this->connection->statement($cypher, [], true);
  4. ConnectionAdapter::statement()
  5. NeoEloquent/Connection::statement()

    $this->getClient()
                ->sendCypherQuery($query['statement'], $query['parameters']) // Get the raw http response, returns `Neoxygen\NeoClient\Formatter\Response`
                ->getResult(); // limit the response to results, discarding raw, body and rows, returns Neoxygen\NeoClient\Formatter\Result
    
  6. Eloquent/Builder::resultsToModelsWithRelations($connection, Neoxygen\NeoClient\Formatter\Result $results) 6.1. $this->GetQuery->getGrammar() 6.2. $results->getAllByIdentifier() // Reads identifiers retrieved from sendCypherQuery()->getResult() 6.3. $this->shouldMutate($identifier) 6.4. Eloquent/Builder::getMutationModel() // Return model class 6.5. Eloquent/Builder::newModelFromNode() // Map node array to model 6.6. Model::newFromBuilder()

Migration Guide

Samples of the responses can be found in the attached html webpages. Neo4j clients responses.zip

heydavid713 commented 4 years ago

@KinaneD how far along is this? Do you guys need any help with it?

KinaneD commented 4 years ago

Hey @heydavid713, we've got somewhere, providing support to causal clusters, but still considerable work and clean-up is required. You can take a look here https://github.com/Vinelab/NeoEloquent/tree/floobits/graphaware.

SimonThordal commented 4 years ago

Hey @KinaneD, I've been working on getting NeoEloquent to work with clustering by creating a bridge to the official Neo4j JavaScript driver using Rialto. I am thinking that the advantage is relying on an officially supported Neo driver. Could that work as an alternative solution for you?

berteltorp commented 4 years ago

A little update for posterity..

As @SimonThordal mentioned above we first thought it would be best to bridge the JS driver, but have since decided to go another route and port the python driver to php instead.

Porting the python driver to php is not a trivial task, and we haven't really gotten started yet.. but we still intend to it! 😅

Mulkave commented 3 years ago

@berteltorp @SimonThordal let us know how we can help! 😄

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.