【问题标题】:Unable to connect to Neo4j with rusted_cypher无法使用 rusted_cypher 连接到 Neo4j
【发布时间】:2021-06-29 17:48:19
【问题描述】:

我正在尝试将 Neo4j 与 Rust 一起使用。目前,没有官方驱动程序。我一直在尝试连接 rusted_cypher 板条箱,但无济于事。我在 Python 中广泛使用过 Neo4j,但我是 Rust 新手。

这是最小的例子:

货物.toml

rusted_cypher = "1.1.0"

main.rs

use rusted_cypher::GraphClient;

fn main() {
    
    let graph = GraphClient::connect(
        "http://<username>:<password>@localhost:7474/<database_name>/data").unwrap();

}

这会返回:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Serde(Error("EOF while parsing a value", line: 1, column: 0))', src/main.rs:6:53
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

当我尝试删除我得到的数据库名称时:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Serde(Error("missing field `extensions`", line: 0, column: 0))', src/main.rs:6:49
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

【问题讨论】:

  • 您可以尝试删除数据库名称吗?
  • 我删除了数据库名称,这也返回了一个错误(我已经编辑了问题以反映这一点)。

标签: rust neo4j serde


【解决方案1】:

似乎生锈的密码不再适用于更改后的数据库 URL,现在是 http(s)//:host:7474/db/&lt;database&gt;/tx

但我发现这两个驱动程序看起来更有前途,最近更新并使用 bolt:

https://github.com/lucis-fluxum/bolt-rs

https://github.com/yehohanan7/neo4rs

文档:https://docs.rs/neo4rs/0.5.8/neo4rs/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-07
    • 1970-01-01
    • 1970-01-01
    • 2021-05-09
    相关资源
    最近更新 更多