Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Builder #16

Open
mrbatista opened this issue May 11, 2015 · 13 comments
Open

Query Builder #16

mrbatista opened this issue May 11, 2015 · 13 comments

Comments

@mrbatista
Copy link
Contributor

Implement "ArangoDB Query Builder" like JavaScript node package module.

@welovelain
Copy link

bump

@Queatz
Copy link

Queatz commented Nov 11, 2017

Would be nice to have this. My queries are getting quite complex!

@christian-lechner
Copy link

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.

@Queatz
Copy link

Queatz commented Nov 26, 2017

Has work been started on this? I may give it a go as well.

@christian-lechner
Copy link

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.

@Queatz
Copy link

Queatz commented Nov 27, 2017

Awesome, can't wait to play around with it! :)

@christian-lechner
Copy link

Just uploaded the first version of the query builder to this repo. Have fun ;)

@Queatz
Copy link

Queatz commented Nov 29, 2017

Awesome, will try it out @christian-lechner 👍

@rocketraman
Copy link
Contributor

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 :-)

@rocketraman
Copy link
Contributor

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.

@m4ttek
Copy link

m4ttek commented Nov 8, 2023

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.

@rashtao
Copy link
Collaborator

rashtao commented Dec 7, 2023

Hi @m4ttek ,
it would be great if you could open source the related code and/or create PR for it.

Thanks!

@m4ttek
Copy link

m4ttek commented Dec 8, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants