{"id":14959441,"url":"https://github.com/neo4j-labs/neo4rs","last_synced_at":"2025-05-14T23:07:31.731Z","repository":{"id":46249585,"uuid":"306382967","full_name":"neo4j-labs/neo4rs","owner":"neo4j-labs","description":"Rust driver for Neo4j","archived":false,"fork":false,"pushed_at":"2025-04-03T12:46:35.000Z","size":1046,"stargazers_count":230,"open_issues_count":45,"forks_count":66,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-13T22:39:16.565Z","etag":null,"topics":["bolt","cypher","cypher-query-language","hacktoberfest","neo4j","neo4j-database","neo4j-driver","rust","rust-crate","rust-lang"],"latest_commit_sha":null,"homepage":"https://docs.rs/neo4rs","language":"Rust","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/neo4j-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2020-10-22T15:36:15.000Z","updated_at":"2025-04-08T05:05:46.000Z","dependencies_parsed_at":"2022-08-30T04:50:24.393Z","dependency_job_id":"ddbe6e90-507a-4686-9932-30b9e825f6ae","html_url":"https://github.com/neo4j-labs/neo4rs","commit_stats":{"total_commits":400,"total_committers":18,"mean_commits":22.22222222222222,"dds":0.55,"last_synced_commit":"b70889c6cec9900028fd243225eb061701b90632"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneo4rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneo4rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneo4rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neo4j-labs%2Fneo4rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neo4j-labs","download_url":"https://codeload.github.com/neo4j-labs/neo4rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243362,"owners_count":22038046,"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":["bolt","cypher","cypher-query-language","hacktoberfest","neo4j","neo4j-database","neo4j-driver","rust","rust-crate","rust-lang"],"created_at":"2024-09-24T13:19:44.491Z","updated_at":"2025-05-14T23:07:26.722Z","avatar_url":"https://github.com/neo4j-labs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Neo4rs [![CI Status][ci-badge]][ci-url]  [![Crates.io][crates-badge]][crates-url]\n\n[ci-badge]: https://github.com/neo4j-labs/neo4rs/actions/workflows/checks.yml/badge.svg\n[ci-url]: https://github.com/neo4j-labs/neo4rs\n[crates-badge]: https://img.shields.io/crates/v/neo4rs.svg?style=shield\n[crates-url]: https://crates.io/crates/neo4rs\n[docs-badge]: https://img.shields.io/badge/docs-latest-blue.svg?style=shield\n[docs-url]: https://docs.rs/neo4rs\n\n`neo4rs` is a driver for the [Neo4j](https://neo4j.com/) graph database, written in Rust.\n\n`neo4rs` implements the [bolt specification](https://neo4j.com/docs/bolt/current/bolt/message/#messages-summary-41)\n\nThis driver is compatible with Neo4j version 5.x and 4.4.\nOnly the latest 5.x version is supported, following the [Neo4j Version support policy](https://neo4j.com/developer/kb/neo4j-supported-versions/).\n\n## API Documentation: [![Docs.rs][docs-badge]][docs-url]\n\n## [Getting Started](https://neo4j.com/docs/getting-started/languages-guides/community-drivers/#neo4j-rust)\n\n\n## Example\n\n```rust\n    // concurrent queries\n    let uri = \"127.0.0.1:7687\";\n    let user = \"neo4j\";\n    let pass = \"neo\";\n    let graph = Graph::new(\u0026uri, user, pass).unwrap();\n    for _ in 1..=42 {\n        let graph = graph.clone();\n        tokio::spawn(async move {\n            let mut result = graph.execute(\n               query(\"MATCH (p:Person {name: $name}) RETURN p\").param(\"name\", \"Mark\")\n            ).await.unwrap();\n            while let Some(row) = result.next().await.unwrap() {\n                let node: Node = row.get(\"p\").unwrap();\n                let name: String = node.get(\"name\").unwrap();\n                println!(\"{}\", name);\n            }\n        });\n    }\n\n    //Transactions\n    let mut txn = graph.start_txn().await.unwrap();\n    txn.run_queries([\n        \"CREATE (p:Person {name: 'mark'})\",\n        \"CREATE (p:Person {name: 'jake'})\",\n        \"CREATE (p:Person {name: 'luke'})\",\n    ])\n    .await\n    .unwrap();\n    txn.commit().await.unwrap(); //or txn.rollback().await.unwrap();\n```\n\n## MSRV\n\nThe crate has a minimum supported Rust version (MSRV) of `1.75.0` as of 0.9.x.\nThe version [0.8.x](https://crates.io/crates/neo4rs/0.8.0) has an MSRV of `1.63.0`\n\nA change in the MSRV in *not* considered a breaking change.\nFor versions past 1.0.0, a change in the MSRV can be done in a minor version increment (1.1.3 -\u003e 1.2.0)\nfor versions before 1.0.0, a change in the MSRV can be done in a patch version increment (0.1.3 -\u003e 0.1.4).\n\n## Implementation progress\n\n\u003e [!IMPORTANT]\n\u003e This driver is a work in progress, and not all features are implemented yet.\n\nOnly Bolt protocol versions 4.0 and 4.1 are supported.\nSupport for later versions is planned and in progress.\n\nThis means, that certain features like bookmarks or element IDs are not supported yet.\n\n## Development\n\n### Testing\n\nThis crate contains unit tests and integration tests.\nThe unit tests are run with `cargo test --lib` and do not require a running Neo4j instance.\nThe integration tests are run with `cargo test` and require a running Neo4j instance.\n\n#### Running the integration tests\n\nTo run the tests, you need to have either docker or an existing Neo4j instance running.\nDocker is recommended since the tests don't necessarily clean up after themselves.\n\n##### Using Docker\n\nTo run the tests with docker, you need to have docker installed and running.\nYou can control the version of Neo4j that is used by setting the `NEO4J_VERSION_TAG` environment variable.\nThe default version is `4.2`.\nThe tests will use the official `neo4j` docker image, with the provided version as tag.\n\nYou might run into panics or test failures with the message 'failed to start container'.\nIn that case, try to pull the image first before running the tests with `docker pull neo4j:$NEO4J_VERSION_TAG`.\n\nThis could happen if you are on a machine with an architecture that is not supported by the image, e.g. `arm64` like the Apple silicon Macs.\nIn that case, pulling the image will fail with a message like 'no matching manifest for linux/arm64/v8'.\nYou need to use the `--platform` flag to pull the image for a different architecture, e.g. `docker pull --platform linux/amd64 neo4j:$NEO4J_VERSION_TAG`.\nThere is an experimental option in docker to use Rosetta to run those images, so that tests don't take forever to run (please check the docker documentation).\n\nYou could also use a newer neo4j version like `4.4` instead, which has support for `arm64` architecture.\n\n##### Using an existing Neo4j instance\n\nTo run the tests with an existing Neo4j instance, you need to have the `NEO4J_TEST_URI` environment variable set to the connection string, e.g. `neo4j+s://42421337thisisnotarealinstance.databases.neo4j.io`.\nThe default user is `neo4j`, but it can be changed with the `NEO4J_TEST_USER` environment variable.\nThe default password is `neo`, but it can be changed with the `NEO4J_TEST_PASS` environment variable.\n\nSome tests might run different queries depending on the Neo4j version.\nYou can use the `NEO4J_VERSION_TAG` environment variable to set the version of the Neo4j instance.\n\nIt is recommended to only run a single integration test and manually clean up the database after the test.\n\n```sh\nenv NEO4J_TEST_URI=bolt://localhost:7687 NEO4J_TEST_USER=neo4j NEO4J_TEST_PASS=supersecret NEO4J_VERSION_TAG=5.8 cargo test --test \u003cname of the integration test, see the file names in lib/tests/\u003e\n```\n\n##### Using an Aura instance\n\n\u003e [!WARNING]\n\u003e Running the tests will create new data and might change and delete existing data or entire databases.\n\u003e Do not use a production instance.\n\nRunning a test against an Aura instance can be done by setting the values as outlined above.\nHowever, the environment variables used do not match the names that are given in the connection file when an Aura instance is created.\n\nBy setting the environment variable `NEO4RS_TEST_ON_AURA` to `1`, the tests will look for the environment variables as they are used in the connection file.\nThe tests can then also be run by using a `dotenv` like tool, e.g.\n\n```sh\ndotenvx run -f .auraenv -e NEO4RS_TEST_ON_AURA=1 -- cargo test\n```\n\n\u003e [!NOTE]\n\u003e Some tests might also use features not available on Aura and will fail.\n\n### Updating `Cargo.lock` files for CI\n\nWe have CI tests that verify the MSRV as well as the minimal version of the dependencies.\nThe minimal versions are the lowest version that still satisfies the `Cargo.toml` entries, instead of the default of the highest version.\n\nIf you change anything in the `Cargo.toml`, you need to update the `Cargo.lock` files for CI.\n\nThis project uses [xtask](https://github.com/matklad/cargo-xtask#cargo-xtask)s to help with updating the lock files.\n\nIt is recommended to close all editors, or more specifically, all rust-analyzer instances for this project before running the commands below.\n\n#### Update `ci/Cargo.lock.msrv`\n\n```bash\n# If there are errors, update Cargo.toml to fix and try again from the top.\n# You might have to downgrade or remove certain crates to hit the MSRV.\n# A number of such downgrades are already defined in the `update_msrv_lock` function\n# in the xtask script.\n# Alternatively, you might suggest an increase of the MSRV.\ncargo xtask msrv\n```\n\nUsing `xtask` requires that `curl` and `jq` are available on the system.\n\n\n#### Update `ci/Cargo.lock.min`\n\n```bash\n# If there are errors, update Cargo.toml to fix and try again from the top.\ncargo xtask min\n```\n\nUsing `xtask` requires that `curl` and `jq` are available on the system.\n\n\n## License\n\nNeo4rs is licensed under either of the following, at your option:\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT License ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fneo4rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneo4j-labs%2Fneo4rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneo4j-labs%2Fneo4rs/lists"}