{"id":15697115,"url":"https://github.com/robsdedude/neo4j-rust-driver","last_synced_at":"2025-05-06T21:06:07.919Z","repository":{"id":113258115,"uuid":"556451834","full_name":"robsdedude/neo4j-rust-driver","owner":"robsdedude","description":"Hobby project: bolt driver for Neo4j written in Rust","archived":false,"fork":false,"pushed_at":"2025-03-23T23:39:38.000Z","size":875,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T21:05:52.265Z","etag":null,"topics":["binary-protocol","cypher","database-driver","driver","graph-database","neo4j","neo4j-database","neo4j-driver","protocol","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/neo4j/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robsdedude.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2022-10-23T21:58:43.000Z","updated_at":"2025-03-23T23:39:42.000Z","dependencies_parsed_at":"2023-03-29T19:47:50.547Z","dependency_job_id":"86d67f34-943e-49cc-b20d-afe99495f82d","html_url":"https://github.com/robsdedude/neo4j-rust-driver","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsdedude%2Fneo4j-rust-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsdedude%2Fneo4j-rust-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsdedude%2Fneo4j-rust-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robsdedude%2Fneo4j-rust-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robsdedude","download_url":"https://codeload.github.com/robsdedude/neo4j-rust-driver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769396,"owners_count":21801376,"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":["binary-protocol","cypher","database-driver","driver","graph-database","neo4j","neo4j-database","neo4j-driver","protocol","rust"],"created_at":"2024-10-03T19:12:19.946Z","updated_at":"2025-05-06T21:06:07.891Z","avatar_url":"https://github.com/robsdedude.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Neo4j Driver for Rust\n=====================\n\nDisclaimer:\n * While I'm currently affiliated with Neo4j, this is my private hobby project.\n   It's not an officially supported piece of software by Neo4j.\n * This is a work in progress, and it's mostly developed in my spare time.\n * This project is primarily meant for private studies.\n   Yet, I decided to publish it as it might be useful for others as well.\n\n\n## Driver\nThis is a driver for Neo4j using the [Bolt protocol](https://7687.org) written in and for Rust.\nIt’s designed to mirror many concepts of the official drivers while leveraging Rust’s expressive type system and lifetime management to provide a safer API that prevents many common pitfalls already at compile time.\n\n### Compatibility\nThis driver supports bolt protocol version 4.4, and 5.0 - 5.8.\nThis corresponds to Neo4j versions 4.4, and the whole 5.x series.\nNewer versions of Neo4j are supported as long as they keep support for at least one of the protocol versions mentioned above.\nFor details of bolt protocol compatibility, see the [official Neo4j documentation](https://7687.org/bolt-compatibility/).\n\n### Basic Example\n\n\u003e [!NOTE]  \n\u003e You can find the full documentation on [docs.rs](https://docs.rs/neo4j/) as well as more examples in the [examples folder](neo4j/examples).\n\n```rust\nuse std::sync::Arc;\n\nuse neo4j::address::Address;\nuse neo4j::driver::auth::AuthToken;\nuse neo4j::driver::{ConnectionConfig, Driver, DriverConfig, RoutingControl};\nuse neo4j::retry::ExponentialBackoff;\nuse neo4j::{value_map, ValueReceive};\n\nlet host = \"localhost\";\nlet port = 7687;\nlet user = \"neo4j\";\nlet password = \"pass\";\nlet database = \"neo4j\";\n\nlet database = Arc::new(String::from(database));\nlet address = Address::from((host, port));\nlet auth_token = AuthToken::new_basic_auth(user, password);\nlet driver = Driver::new(\n    // tell the driver where to connect to\n    ConnectionConfig::new(address),\n    // configure how the driver works locally (e.g., authentication)\n    DriverConfig::new().with_auth(Arc::new(auth_token)),\n);\n\n// Driver::execute_query() is the easiest way to run a query.\n// It will be sufficient for most use-cases and allows the driver to apply some optimizations.\n// So it's recommended to use it whenever possible.\n// For more control, see sessions and transactions.\nlet result = driver\n    // Run a CYPHER query against the DBMS.\n    .execute_query(\"RETURN $x AS x\")\n    // Always specify the database when you can (also applies to using sessions).\n    // This will let the driver work more efficiently.\n    .with_database(database)\n    // Tell the driver to send the query to a read server.\n    // In a clustered environment, this will make sure that read queries don't overload\n    // the single write server.\n    .with_routing_control(RoutingControl::Read)\n    // Use query parameters (instead of string interpolation) to avoid injection attacks and\n    // improve performance.\n    .with_parameters(value_map!({\"x\": 123}))\n    // For more resilience, use retry policies.\n    // Especially in a clustered environment, this will help to recover from transient errors\n    // like those caused by leader elections, which are to be expected.\n    .run_with_retry(ExponentialBackoff::default());\nprintln!(\"{:?}\", result);\n\nlet result = result.unwrap();\nassert_eq!(result.records.len(), 1);\nfor mut record in result.records {\n    assert_eq!(record.values().count(), 1);\n    assert_eq!(record.take_value(\"x\"), Some(ValueReceive::Integer(123)));\n}\n```\n\n\n## MSRV\nCurrently, this crate's minimum supported Rust version is `1.70`.\nA bump in MSRV is considered a minor breaking change.\n\n\n## Feature Progress\n * [x] (Well-Written) Docs and Examples\n * [ ] Driver\n   * [ ] Config\n     * [x] `user_agent`\n     * [x] `auth`\n       * [x] basic\n       * [x] kerberos\n       * [x] bearer\n       * [x] custom\n     * [x] `max_connection_pool_size`\n     * [x] `fetch_size`\n     * [x] `connection_timeout`\n     * [x] `connection_acquisition_timeout`\n     * [x] `resolver`\n     * [x] `max_connection_lifetime`\n     * [x] `liveness_check_timeout` (called `idle_time_before_connection_test`)\n     * [x] routing and direct connections\n     * [x] `keep_alive`\n     * [x] `TLS`\n     * [ ] mTLS for 2FA\n   * [x] `.session`\n   * [x] `.supports_multi_db`\n   * [x] `.supports_session_auth`\n   * [x] `.execute_query`\n   * [x] `.verify_connectivity`\n   * [x] `.verify_authentication`\n   * [x] `.get_server_info`\n   * [x] `.is_encrypted`\n * [x] Session\n   * [x] Config\n     * [x] database\n     * [x] bookmarks\n     * [x] impersonated_user\n     * [x] fetch_size\n     * [x] session_auth\n   * [x] Auto Commit\n   * [x] Transaction\n     * [x] Config\n       * [x] Metadata\n       * [x] Timeout\n     * [x] Unmanaged\n     * [x] With Retry\n * [ ] Result (`RecordStream`)\n   * [x] `.keys`\n   * [x] `.consume` (Summary)\n     * [x] `.server_info`\n       * [x] `.address`\n       * [x] `.server_agent`\n       * [x] `.protocol_version`\n     * [x] `.database`\n     * [x] `.query`, `.parameters` (won't implement)\n     * [x] `.query_type`\n     * [x] `.plan`\n     * [x] `.profile`\n     * [x] `.notifications`\n     * [x] `.counters`\n     * [x] `.result_available_after`\n     * [x] `.result_consumed_after`\n   * [x] `.single`\n   * [ ] `.into::\u003cEagerResult\u003e()`\n   * [ ] `.closed` (not sure if needed?)\n   * [ ] Record\n     * [x] most basic functionality\n     * [ ] ergonomic way to access by key\n * [x] Bookmark Management\n * [x] Protocol Versions (including features introduced to the official drivers with each version)\n   * [x] 4.4\n   * [x] 5.0 (utc fix)\n   * [x] 5.1 (re-auth)\n   * [x] 5.2 (notification filtering)\n   * [x] 5.3 (bolt agent)\n   * [x] 5.4 (telemetry)\n   * [x] 5.5 (never released)\n   * [x] 5.6 (GQL notifications)\n   * [x] 5.7\n     * [x] (GQL errors)\n     * [x] (new bolt version handshake)\n   * [x] 5.8 (home db resolution cache)\n * [x] Types\n   * [x] `Null`\n   * [x] `Integer`\n   * [x] `Float`\n   * [x] `String`\n   * [x] `Boolean`\n   * [x] `Bytes`\n   * [x] `List`\n   * [x] `Map`\n   * [x] `Node`\n   * [x] `Relationship`\n   * [x] `Path`\n   * [x] `Spatial` (point)\n   * [x] `Temporal` (date, time, datetime, duration)\n * [ ] Proper Unit Tests\n * [x] CI\n   * [x] rustfmt\n   * [x] clippy\n   * [x] Unit Tests\n     * [x] Public API SemVer Compatibility Tests ([cargo-public-api](https://github.com/enselic/cargo-public-api))\n   * [x] Exposed Dependency Types Check ([cargo-check-external-types](https://github.com/awslabs/cargo-check-external-types))\n   * [x] TestKit\n\n\n## Note on async\nCurrently, there are no plans to add async support until a proper abstraction over multiple runtimes is available so that users can choose their preferred runtime.\nAs it stands, the async ecosystem would either force this crate to dictate a runtime or do an ugly dance to support multiple runtimes.\nEven then, the supported runtimes would be limited to the ones chosen by this crate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobsdedude%2Fneo4j-rust-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobsdedude%2Fneo4j-rust-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobsdedude%2Fneo4j-rust-driver/lists"}