Latest major releases of Neo4j.rb gems
We are extremely excited to announce the latest release of the Neo4j.rb Ruby gems (version 8.0 of
neo4j and 7.0 of
neo4j-core). With over a year since the last major releases, the new Ruby gems bring a number of big changes. For these versions in particular we had a lot of help from many members of our community with 216 and 445 commits for the
neo4j gems respectively. We'd like to thank GitHub users:
isaacsanders for their commits as well as all of the users who submitted issues and asked questions in our Gitter room, in the
#neo4j-ruby channel on the Neo4j Slack group, and on StackOverflow.
The biggest and most important change to the
neo4j-core gem is the addition of support for the binary Bolt protocol introduced in Neo4j 3.0 (older versions of the gems still supported Neo4j 3.0+ via HTTP and embedded modes).
The Neo4j.rb project was originally created as jRuby-only interface to use Neo4j embedded in the Ruby process. When Neo4j introduced it's HTTP JSON APIs, support for HTTP was added in version 3.0 of both gems. With the addition of the bolt protocol, we decided that rather than bolting (get it?) on support that we would rebuild the
neo4j-core APIs to create a cleaner, adaptor-based interface for our users. The old API still is available with support for HTTP and embedded modes, but all users are encouraged to adopt the new API.
In the new API, there is no longer an idea of a "current" session (though there is now such a concept in the
neo4j gem for
ActiveRel). Because of this users of
neo4j-core must retain a reference to the session themselves and must create a new session for each thread if using more than one thread.
Lastly, the new API supports the concept of making more than one query at once, which can allow for batch queries in one http request.
For more details on interface changes, please see our upgrade guide
For more details on all changes, please see the
Of course the 8.0 version of the
neo4j gem has been heavily modified to use the new API from
neo4j-core 7.0 under the covers. Users of the
neo4j gem won't need to change much. Some highlights:
server_dbmode has been removed and you must specify either
- When configuring Neo4j in Rails, the
session_optionshave been removed. This can be fixed by simply replacing the
- Outside of Rails the
Neo4j::ActiveBase.on_establish_sessionmethods can be used to setup sessions for
- Magic creation of indexes and constraints defined in
ActiveNodemodels is no longer available. It is suggested that users use our new migrations functionality (helpful errors are raised, but also see this section of our upgrade guide for details).
Again, for more details, please see our upgrade guide
There are many more features to talk about with version 8.0 of the
neo4j gem. Some highlights:
- Official Migrations support based off of
ActiveRecord's implementation (a huge thanks to ProGM for building this almost entirely single-handedly. See our migrations documentation)
- Support for undeclared properties (see PR #1294 for details. Thanks to
- Support for using Neo4j internal IDs for
id_property(to be used with care since Neo4j IDs can be recycled. Thanks to
For more details on the many changes changes to the
neo4j gem, please see our CHANGELOG
Tagged with news