gobuffalo / pop

A Tasty Treat For All Your Database Needs
MIT License
1.42k stars 242 forks source link

Feat : Graph database support // Graph query language #464

Open hubyhuby opened 4 years ago

hubyhuby commented 4 years ago

Description

Graph database seems to get much traction those days. In august 2019 dgraph (a go graph) raised 11 Million USD. Joining the mature graph databases such as neo4j. Buffalo / POP has been build upon the REST API concepts.

This feature request, is to discuss with the community the possibility to connect to such Graph Database in the Buffalo / POP ecosystem.

Also GraphQL is not considered beeing specifically a graph database query language, it is offered as a query language by all the graph databases.

Reference discussion on slack: https://gophers.slack.com/archives/C3MSAFD40/p1572595440145200

Expected Behavior

An idea of implementation MIGHT be : -We would be able to start a project with buffalo as usual. -Then we could modify the "database.yml" file to specify "dialect:graphql" (or another like Gizmo...). -Then creation and migration would be done with POP as usual. -The POP ORM would work ""as usual"" for the end user, meaning the current set of the API would work ... A new super set of the POP API would let us manipulate graph requests (maybe something along the line of gizmo) ...

aeneasr commented 4 years ago

https://github.com/gobuffalo/pop/issues/4

mysticaltech commented 4 years ago

It would be awesome, I'm thinking to not use gobuffalo because it lacks support for dgraph!

mclark4386 commented 4 years ago

So just to make sure I understand the proposal properly, y'all are wanting to basically use pop as an ORM in front of a graphql DB? Don't want to make a graphql interface through pop, but pop interface into graphql, correct?

aeneasr commented 4 years ago

GraphQL is a query language for edge devices (e.g. smartphone apps) and is not to be confused with Neo4J or other Graph Databases (I forgot their names).

The problem is that Graph traversal and querying is vastly different from the standard „ORM“ish model and what sqlx (which pop uses below) is capable of. If I were a maintainer I would leave this as a nofix and keep the scope of pop as clear and defined as possible. Writing a resiliant, fault-resistant and bugfree ORM is hard enough, let’s not cave into more exotic use cases. Especially because Graph databases aren’t really useful for what pop is generally being used for, and because their query languages are (a) heterogenous (b) hard to abstract

aeneasr commented 4 years ago

Sorry, I overlooked that the OP mentioned GraphQL. I was not aware that Neo4J and others support GraphQL

mclark4386 commented 4 years ago

When I read the title I felt the same way, but then reading the requested features it seems like they just want to make a dialect that goes ahead of a the db... which if someone wants to implement I would be willing to review, but I do see it as putting a dog collar on a dragon and expecting to walk it down the street...

mysticaltech commented 4 years ago

Hey guys, I understand, it's just that dgraph natively supports GraphQL and I had the fantasy of using this "a la rails" active model style, but it seems I am far out imagining things. From my limited perspective, that issue is now a nofix too.