domvas
Hi Elixir world,
last night, bolt_sips v2 was released by @Florin, which means that Neo4j Entreprise Edition is now covered by the driver.
Using bolt_sips can be rough sometimes, especially in a Phoenix project when you wan to use Ecto… and can’t.
That’s the purpose of EctoNeo4j, have (almost) all the Ecto features, from Shema to Repo work with Neo4j.
You can find the library here: ecto_neo4j | Hex
You can now enjoy your Repo.*, have your migrations work, etc. But remember that Ecto is designed for relational database and Neo4j is a graph database then not all Ecto features work. So don’t expect join, etc. to work.
Additionnally, Ecto.Query is sql-oriented then only simple cypher query are supported (i.e on one node or one label).
See docs for more information.
Hope this library will help you.
And thanks to @Florin and @mschae for their work on bolt_sips and boltex!
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #security











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Florin
@domvas - thank you so much for the shoutout, and for your feedback and support. We had lots of users asking us for an Ecto driver, for Neo4j, and I think your project will fill up that gap, perfectly. Good luck with your new project, and thanks again for the shoutout
mschae
I second @Florin: Thanks for making this work and thanks for the shoutout. Great to see the neo4j/Elixir ecosystem prosper!
domvas
Version 0.6.2 of ecto_neo4j is out with… a (light) relationship support.
It was a bit like putting squares in triangles but it works for simple operations, which ease the data management.
It is now possible to
insert,update,preloadyour relationship in a classic ecto way even if specific functions (with same name) need to be used.A comprehensive doc has been added too: Up and running — EctoNeo4j v0.6.6
which demonstrate all the features with examples.
Hope you’ll enjoy this new version.
conradwt
@domvas Hi, thanks so much for creating as well as keeping this package up to date. Also, thanks for adding details about its implementation and how it relates to Ecto. Well done!!!

domvas
As I said in another topic, note that soon ecto_neo4j won’t be maintained anymore.
Having a way to connect Neo4j and Ecto has been a dream for most of Neo4j’s users who love Elixir, but in the end, it’s an unsolvable problem: graph concept doesn’t fit in relational ones.
ecto_neo4j was an attempt, and yes it has some good parts but you can’t have a really nice modeled graph if you always have to think relational…
But don’t be alarmed, it’s not my goal to leave you with unmaintained / unsatisfying package. An other one is on its way and will be soon available (in the next few days if I’m a genius, so maybe next few weeks :D). It’ll be announced here on elixir forum so keep it touch!
mindreader
I’m interested to see what you have in mind.
It seems like it would be fairly easy to implement a cypher dsl that would in all likelihood work a lot better than ecto’s sql dsl anyways (not a jab at ecto_sql, just that sql is not very composable).
domvas
I’m not sure to understand what you’re looking for.
Could you elaborate?
mindreader
Imagine you have some ecto schemas.
In cypher you would need to create nodes and relations, so you would do so like this in elixir
And then relations
Now you can start making statements, such as match
You would just have to have a query struct that held each binding and enough information to turn it into a fragment of cypher statement.
domvas
for schema, you can already have a look here: Schema — Seraph v0.2.4
With this, everything you can think of as a graph model can fit in, except for one thing: multiple relationship with same type between same node (ex: multiple :WROTE between :User and :Post) which is possible in Neo4j but does not make sense in real life.
For the DSL, I didn’t take the node/x approach because of the proxmity with Kernel.node/1,2 and go on a more “cypher” path.
Nodes are like this:
Relationships like this:
for query, what you wrote will be like this:
And, little trick, order DOES matter, writing this
will result in a syntax error from Neo4j because it translates to:
This is maybe this point that can make composition a bit tricky.
But I think it’s mandatory if we want to be able to write quite complex queries, or just to put the
OPTIONAL MATCHexactly where we want.mindreader
Sounds like you are basically in the same frame of mind as I am. I look forward to checking out your new code.