Open mrbatista opened 9 years ago
bump
Would be nice to have this. My queries are getting quite complex!
Seems that some people are interested in an ArangoDB Query Builder. I also need one for a current project, so I started writing one myself.
If I find some extra time I will release it as an independent module. Maybe some of you are interested in contributing to such a project. Any help is much appreciated, as this module is only a byproduct and certainly won't get the attention it needs.
Has work been started on this? I may give it a go as well.
I have already done a good portion of the job. I took the ArangoDB Bison grammar file as a template to build a fluid query builder. So you can do the following:
String query = query()._for("doc").in(bindParam("@coll"))._return("doc").toAQL();
System.out.println(query); // prints FOR `doc` IN @@coll RETURN `doc`
I hope I can upload the first prototype at the weekend.
Awesome, can't wait to play around with it! :)
Just uploaded the first version of the query builder to this repo. Have fun ;)
Awesome, will try it out @christian-lechner 👍
Any official news on progress towards a query builder? @christian-lechner 's repo has not been updated in 7 months, which is either a very good thing, or a very bad one :-)
One thing the rethinkdb guys did was generate a good portion of their client driver code from the query language definition. It seemed to work quite well, as their Java client driver and query builder was a pleasure to use. It's possible their scripts could be a starting point to do the same for ArangoDB:
See the section "A behind the scenes look at how we brewed the Java driver" at https://rethinkdb.com/blog/official-java-driver/. There are links to the open source they used to do the code generation.
Hi,
I'd like to announce that we're using Arango in Sages company, and we've created both java and kotlin support for Arango Query DSL.
In Java queries looks like:
filter(
and(
exp(path("conflictReason", "conflictType"), EQ, "@conflictType"),
exp(path("key"), LIKE, "@pattern")
)
)
whereas in kotlin it looks like:
private val query =
(FOR("doc") IN bindCollection("collection"))(
RETURN("doc")
)
It can be easily integrated with JNOSQL with the usage of the DocumentTemplate
class.
We can open source this code if you wish.
Hi @m4ttek , it would be great if you could open source the related code and/or create PR for it.
Thanks!
Hi @rashtao,
Great, I'll talk to my boss about the strategy of open sourcing it under com.arangodb
package but with additional javadocs indicating our company if you don't mind.
I reckon we can start with Java code as it matches this repository, and then think about incorporating Kotlin.
Implement "ArangoDB Query Builder" like JavaScript node package module.