Overview

Requirements

Scala 2.12/2.11

Java 8+

neo4j 3..+

Session creation

neotypes adds an extension method (.asScala[F[_]: Async]) to org.neo4j.driver.v1.Session and org.neo4j.driver.v1.Driver that allows to build a neotypes’s session and driver wrappers. You can
parametrize asScala by any type that you have a typeclass neotypes.Async implementation for. The typeclass implementation for scala.concurrent.Future is
built-in (Please read more about [side effect implementations][alternative_effects.html]). Please note that you have to make sure that the session is properly closed at the end of the application execution if you decide to manage session lifecycle manually.

In this case, the session will be properly closed after query execution.

Query execution

Once you have a session constructed, you can start querying the database. The import neotypes.implicits._ adds an extension method query[T] to each
string literal in its scope or you can use string interpolation. Type parameter [T] specifies a resulted return type.

execute(s) - executes a query that has no return data. Query can be parametrized by org.neo4j.driver.v1.summary.ResultSummary or Unit. If you need to support your return types for this
type of queries, you can provide an implementation of ExecutionMapper for any custom type.