Coder Social home page Coder Social logo

Adding new commands about arangolite HOT 9 CLOSED

solher avatar solher commented on August 17, 2024
Adding new commands

from arangolite.

Comments (9)

solher avatar solher commented on August 17, 2024

In fact, I just wanted to keep things really clear and separate the driver implementation (models + core querying system) from the implementation of new queries. That's why I wanted to keep those new queries/implementations inside a separate file.
But obviously, I don't have any problem with having it sorted in multiple files like edge_requests.go, database_requests.go, etc.

from arangolite.

solher avatar solher commented on August 17, 2024

And BTW, what kind of edge feature would you like to add ? One can already create edges with AQL so would it be an abstraction ? I don't want to add a lot of ORMish methods and become like AranGO.

from arangolite.

PascalLeMerrer avatar PascalLeMerrer commented on August 17, 2024

I'm definitely not wanting to add more features than necessary.

I wanted to add a create edge feature, but only because I thought it wasn't possible using AQL.
I'm still discovering ArangoDB, so I may be wrong. This page of the documentation lead me to think that only graph reading operations were possible; Am I wrong? If so, how do you create an edge or a graph with AQL?

from arangolite.

solher avatar solher commented on August 17, 2024

To create edges, you can just create an edge collection and insert one inside with a regular

INSERT {'_from': 'node/1','_to': 'node/2'} IN edges

For graphs, I didn't implemented the HTTP graph API because it is really slow.
I use the AQL graph functions instead: https://docs.arangodb.com/Aql/GraphFunctions.html

The graph objects are just an abstraction to make the graph operations easier but you can do everything without them.

from arangolite.

PascalLeMerrer avatar PascalLeMerrer commented on August 17, 2024

Thanks for this information, Fabien.
However, I still think graph creation should be added, as it can't be done through AQL (and I need it in my project. I want the database to be created by the application when it does not exist). Unless you have another wordaround?

from arangolite.

solher avatar solher commented on August 17, 2024

What do you mean when you say it can't be done through AQL ?

The graph API (https://docs.arangodb.com/HttpGharial/index.html) only allows to create graph objects which can be used to simplify AQL queries by using graph operations (https://docs.arangodb.com/Aql/GraphOperations.html) instead of graph functions (https://docs.arangodb.com/Aql/GraphFunctions.html). But in any case, you do it through AQL.

Same question, what do you mean by "I want the database to be created by the application when it does not exist" ? It isn't related to the graph API.

That being said, it would be amazing if you could implement the graph API as it is always good to support more features :)

from arangolite.

PascalLeMerrer avatar PascalLeMerrer commented on August 17, 2024

When I say you can't create a graph using AQL, I refer to the graph
management feature
.
Using the HTTP API you may create a graph using a POST request:

curl -X POST --data-binary @- --dump - http://localhost:8529/_api/gharial <<EOF
{
  "name" : "myGraph",
  "edgeDefinitions" : [
    {
      "collection" : "edges",
      "from" : [
        "startVertices"
      ],
      "to" : [
        "endVertices"
      ]
    }
  ]
}

If my understanding is correct, there is no way to do this using the
current version of arangolite, unless I directly invoke the send
function, isn't it?

When I say "I want the database to be created by the application when it
does not exist", it's a requirement of my application, indeed. I would like
the collections, edge collections and graphs to be created by the app, when
I start it with an empty database. Which implies arangolite should allow me
to send requests to create collections, edge collections and graphs. Hence
my questions. I must admit I forgot the possibility to invoked send(); so
I'll see if I use the low level send method or if extend the driver to add
some graph related features.

from arangolite.

solher avatar solher commented on August 17, 2024

You're totally right.
I'd be glad if you could add it :)

from arangolite.

solher avatar solher commented on August 17, 2024

Merged. Thanks again !

from arangolite.

Related Issues (17)

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.