{"id":13481411,"url":"https://github.com/outr/neo4akka","last_synced_at":"2025-04-19T16:21:40.728Z","repository":{"id":144531705,"uuid":"61987555","full_name":"outr/neo4akka","owner":"outr","description":"Neo4j Scala client using Akka-Http","archived":false,"fork":false,"pushed_at":"2017-03-09T15:50:08.000Z","size":23,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T15:50:44.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-26T12:13:41.000Z","updated_at":"2021-12-28T00:09:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"c80f7eba-6fce-4a1f-951f-7928ff6f8064","html_url":"https://github.com/outr/neo4akka","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fneo4akka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fneo4akka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fneo4akka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outr%2Fneo4akka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outr","download_url":"https://codeload.github.com/outr/neo4akka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224959990,"owners_count":17398790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:51.599Z","updated_at":"2024-11-16T19:24:41.128Z","avatar_url":"https://github.com/outr.png","language":"Scala","funding_links":[],"categories":["Database"],"sub_categories":[],"readme":"# neo4akka\n\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/43729f4be7514d6e82c27a9495ab296d)](https://www.codacy.com/app/matthicks/neo4akka?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=outr/neo4akka\u0026utm_campaign=badger)\n[![Build Status](https://travis-ci.org/outr/neo4akka.svg?branch=master)](https://travis-ci.org/outr/neo4akka)\n[![Stories in Ready](https://badge.waffle.io/outr/neo4akka.png?label=ready\u0026title=Ready)](https://waffle.io/outr/neo4akka)\n[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/outr/neo4akka)\n[![Maven Central](https://img.shields.io/maven-central/v/com.outr/neo4akka_2.11.svg)](https://maven-badges.herokuapp.com/maven-central/com.outr/neo4akka_2.11)\n\nNeo4j client for Scala using Akka-Http\n\nAll existing Scala clients try to be too clever adding obfuscation on top of the communication, creating a limiting DSL, or not using true non-blocking communication.\n\nAt its core this client will attempt to be a very clean and representative client allowing full use of Neo4j with Akka-Http in an entirely non-blocking way while still remaining true to the Cypher query language.\n\n## Status\n\nFully functional API that supports the majority of use-cases but ongoing development is still happening to make it more\nuseful and convenient.\n\n## Features for 1.0.0\n\n* [X] Asynchronous, true non-blocking IO with Akka HTTP\n* [X] Cypher String Interpolator\n* [X] Cypher Query Parser\n* [X] Cypher Query Parser via Macro on Interpolation at compile-time\n* [X] Structured QueryResponse\n* [X] Macro support for extracting case class from QueryResponse\n\n## Features for 1.1.0\n* [ ] Insert and update from case class into database\n* [ ] Transactions\n* [ ] Practical Pagination support\n\n## Documentation\n\nIn desperate need of help. For now just look at the tests until we can get the first release finished.\n\n## Setup\n\nneo4akka is published to Sonatype OSS and Maven Central and supports JVM with 2.11 and 2.12:\n\n```\nlibraryDependencies += \"com.outr\" %% \"neo4akka\" % \"1.0.1\"\n```\n\n## Using\n\n### Imports\n\nThe only import necessary to use neo4akka is the following import along with an execution context for futures:\n\n```scala\nimport com.outr.neo4akka._\n\nimport scala.concurrent.ExecutionContext.Implicits.global\n```\n\n### Creating a Session\n\nSupply the host, port, and credentials to validate and establish a session with neo4j:\n\n```scala\nval sessionFuture[Future[Neo4Akka]] = Neo4Akka(\"localhost\", 7474, \"neo4j\", \"password\")\n```\n\n### Creating a Query\n\nWith neo4akka's powerful Cypher language interpolation (uses neo4j's built-in query validation) we can create compile-time\nvalidated Cypher queries with ease:\n\n```scala\nval name = \"Tom Hanks\"\nval query = cypher\"MATCH (p: Person {name: $name}) RETURN p\"\n```\n\nIf the query is malformed compilation will fail and injected arguments are properly assigned to the argument list for sending\nto the database as unique arguments.\n\n### Executing a Query\n\nSince our `Neo4Akka` instance may or may not have completed yet, we can `flatMap` the `Future` in order to execute the\nquery against the database and get back a `Future[ResultSet]`. For the purposes of this example, we'll simply do a blocking\n`Await` to get the `ResultSet`:\n\n```scala\nval resultSetFuture[Future[ResultSet]] = sessionFuture.flatMap(session =\u003e session(query))\nval resultSet: ResultSet = Await.result(request, Duration.Inf)\n```\n\n### Processing Results\n\nNow that we have a `ResultSet` we can access the return `p` from our query by name and use a compile-time Macro to populate\na case class `Person` with the values:\n\n```scala\ncase class Person(name: String, born: Int)\n\nval people: Vector[Person] = resultSet(\"p\")[Person]\n```\n\n### Disposing\n\nBecause neo4akka uses Akka Actors internally, it must be properly disposed to release the `ActorSystem` and `ActorMaterializer`.\n\nNote: An instance of `Neo4Akka` uses Akka HTTP for true asynchronous non-blocking IO, so there is no state or unsafe reference\ninformation stored in the `session`.\n\n```scala\nsessionFuture.map(_.dispose())\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutr%2Fneo4akka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutr%2Fneo4akka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutr%2Fneo4akka/lists"}