Are you using Elixir for connecting to Neo4j graph databases? Then we would love your feedback!

Hi there,

We’re working on the docs and adding final touches to the Neo4j driver for Elixir: Bolt.Sips, and we need your feedback. The development of the latest version was moved to the public area (on GitHub), for offering you an early preview of what’s coming.

The documentation for the new features, functions and modules, including the new docs/ sections, etc. is work in progress pretty much, however, the code is stable and it can be used for experimenting with the new features introduced by this version:

  • routing
  • role based connections
  • multi-tenancy
  • better support for errors
  • and so much more

If anyone here using Elixir, for connecting to Neo4j, and wanting to test this new version, then we’d love to have your feedback. You can use this new driver for connecting to a single Neo4j server, to a Neo4j causal cluster or to … multiple servers … or to … multiple clusters, concurrently! w⦿‿⦿t! :slight_smile:

If you’re interested, please join our project at github.com/florinpatrascu/bolt_sips, and we’ll be happy to work with you through examples, while augmenting our docs and code, based on your feedback and suggestions. Any feedback is: good feedback :slight_smile:

Thank you!
:heart:

6 Likes

Yes I am interested.

I have this project

This extract data (well all of) the contentful space into a neo4j graph database.

1 Like

That’s awesome! Please check the new version if you have time, and share with us your experience. Plus if you spot any bugs or place for improvements then don’t hesitate to contribute with opening issues or PRs. Many thanks!!

I also have:

This loads the dependencies from package.json in a node project into a neo4j graph database.
I took an unusual approach with starting bolt - it starts a runtime so that you can specify the destination neo4j database from the cli.

1 Like

Here are my notes on converting package_compare to use the new version.

The github repo says to use v2 but its not yet in hex.pm.
For now you need to use:

{:bolt_sips, git: “https://github.com/florinpatrascu/bolt_sips”}

poison is now on version 4 and you are using version 3 so I have had to downgrade.

This is the code that I am trying to translate:

def start(database, username, password) do
    Bolt.Sips.start_link(%{url: database, username: username, password: password})
  end

  def write_to_neo4j(data) do
    conn = Bolt.Sips.begin(Bolt.Sips.conn)
    
    #Nodes need to be reversed as prefixed by delete statements
    entry_data = Enum.reverse(data.nodes)
    Enum.each(entry_data, fn(item) -> 
       Bolt.Sips.query(conn, item.query, item.params)  
    end )

    #Relationships include the properties
    Enum.each(data.relationships, fn(item) -> 
       Bolt.Sips.query(conn, item.query, item.params)  
    end )

    Bolt.Sips.commit(conn)
  end   

I am kind of stuck.

1 Like

Thank you for the feedback so far. I didn’t publish the driver yet, since there are functions where I still need to update the docs, but there are only so many hours in a day :slight_smile: I’ll make sure I’ll add a note about that in the main README, ty!

Regarding the way you’re using the transactions; I believe you’re using a very old version of the driver, because the support for non-closure based transactions was dropped since a couple of releases ago. In fact I mentioned this in the CHANGELOG, when that happened: https://github.com/florinpatrascu/bolt_sips/blame/master/CHANGELOG.md#L94

We are using the awesome DBConnection under the hood, but we had to drop this transaction style when it wasn’t supported by the DBConnection either. There are clarifying discussions on this topic, in the issues tracker of DBConnection.

However, you can easily convert your code to using the new transaction style, An example from the actual tests we’re using:

  test "execute statements in transaction", %{main_conn: main_conn} do
    Bolt.Sips.transaction(main_conn, fn conn ->
      book =
        Bolt.Sips.query!(conn, "CREATE (b:Book {title: \"The Game Of Trolls\"}) return b")
        |> Response.first()

      assert %{"b" => g_o_t} = book
      assert g_o_t.properties["title"] == "The Game Of Trolls"
      Bolt.Sips.rollback(conn, :changed_my_mind)
    end)

    books = Bolt.Sips.query!(main_conn, "MATCH (b:Book {title: \"The Game Of Trolls\"}) return b")
    assert Enum.count(books) == 0
  end

Hope this helps?!

Also, I believe for specific issue like these, discussing them in the project’s own issue tracker would be more appropriate, if you don’t mind?! Will be easier for us to track the issues, plus I am sure the kind viewers here will appreciate lesser traffic on topics not as popular as others as graphdbs are a niche … for now :slight_smile:

Thanks again!

Shame on me, I’m discovering this topic only now…
Will keep on eye on it now!

1 Like