As we always in search for new and perspective tools, today we brought Gremlex to share with you. Gremlex is an Elixir client for Gremlin, a simple to use library for creating Gremlin queries. At the moment it is still in development and does not support all Gremlin queries. But it definitely worth your attention. Let’s take a closer look at Gremlex – open source Gremlin server driver for Elixir!
For those of you who don’t know, Gremlin (Apache TinkerPop) is a functional, data-flow language that enables users to succinctly express complex traversals on (or queries of) their application’s property graph. It is available on all Apache TinkerPop™- enabled graph databases, including AWS Neptune, CosmosDB, Neo4j, and OrientDB.
Gremlex library was created especially for those people who want to use a graph database, but don’t want to write database commands as raw strings. Gremlex is supposed to be used for composing Gremlin queries. It also supports nested Gremlin queries.
Gremlex basic usage
The two main modules:
It is the module that hosts all the functions needed to build a Gremlin query.
Once you’ve defined your query, you can simply call
Gremlex.Client.query/1to perform it.
Gremlex uses a helper to read and use application configuration from environment variables so that you can easily define your configuration to use environment variables when it comes time to deploying.
p.s. Read more about functional programming, its pros and cons.