0xsio / bolt-rs Goto Github PK
View Code? Open in Web Editor NEWCommunicate with Bolt-compatible graph databases in Rust! โก๐ฉ
License: Mozilla Public License 2.0
Communicate with Bolt-compatible graph databases in Rust! โก๐ฉ
License: Mozilla Public License 2.0
First of all - thank you for the work you do!
As title said - bolt-client v0.8.0 fails to compile with bolt-proto v0.9.2
I believe error is in bolt-client's dependency on bolt-proto
bolt-proto = "^0.9.0" //this will pick latest...
I had to lock bolt-proto with "cargo update -p bolt-proto --precise 0.9.1"
cargo tree | grep bolt
โโโ bb8-bolt v0.5.0
โ โโโ bolt-client v0.8.0
โ โ โโโ bolt-client-macros v0.2.1 (proc-macro)
โ โ โโโ bolt-proto v0.9.2
โ โ โ โโโ bolt-proto-derive v0.5.2 (proc-macro)
โ โโโ bolt-proto v0.9.2 ()
โโโ bolt-client v0.8.0 ()
โโโ bolt-proto v0.9.2 (*)
==================== Build error ==============================================
Compiling bolt-client v0.8.0
error[E0277]: the trait bound Vec<bytes::Bytes>: From<bolt_proto::Message>
is not satisfied
--> /home/soleinik/.cargo/registry/src/github.com-1ecc6299db9ec823/bolt-client-0.8.0/src/client.rs:75:42
|
75 | let chunks: Vec = message.try_into()?;
| ^^^^^^^^ the trait From<bolt_proto::Message>
is not implemented for Vec<bytes::Bytes>
|
= help: the following implementations were found:
<Vec<T, A> as From<Box<[T], A>>>
<Vec as From<&[T]>>
<Vec as From<&mut [T]>>
<Vec as From<BinaryHeap>>
and 6 others
= note: required because of the requirements on the impl of Into<Vec<bytes::Bytes>>
for bolt_proto::Message
= note: required because of the requirements on the impl of TryFrom<bolt_proto::Message>
for Vec<bytes::Bytes>
Actually we are connecting to the default database "neo4j" but we would like to other database because we are using an neo4j cluster and logically we are splitting the databases.
In the example here https://docs.rs/bolt-client/0.10.1/bolt_client/index.html There is this line
let stream = BufStream::new(stream).compat();
Where BufStream
is imported with
use tokio::io::BufStream;
When i go to the documentation of this type https://docs.rs/tokio/1.15.0/tokio/io/struct.BufStream.html i don't see the method compat
Additionally i have a question. I would like to build up the stream and client and then store the client variable in another struct to make it available throughout my application. I can't quite get the type of Client
right because i don't know what to fill in for S
in Client<S: AsyncRead + AsyncWrite + Unpin>
i tried bolt_client::Client<BufStream<bolt_client::Stream>>
but couldn't verify it due to compile failure of compat
. Would appreciate feedback on this type.
deadpool_bolt::Manager
does not derive Debug. It would be nice if it did.
I'm trying to turn the records I get from a query into json; however I haven't found any easy way to do that. I tried to use custom serialisation using serde_json but I found that I cannot access the underlying value
of the different Value types that are supported.
Is there any way we can get hold of the underlying value so custom serialization into different types could be possible?
Given that I had to write https://github.com/lucis-fluxum/bolt-rs/blob/b6d05ab2aec94b0f6ebf8b760c5946dab8bcfe57/bolt-client/src/client/v1.rs#L505 and https://github.com/lucis-fluxum/bolt-rs/blob/b6d05ab2aec94b0f6ebf8b760c5946dab8bcfe57/bolt-client/src/client/v2.rs#L1 in response to issues encountered with the remote test DB, I thought I'd open an issue to document how I'm resolving this.
I use a GrapheneDB instance running Neo4j 3.5.17 for running this project's tests against a remote server, and I found that it violates the Bolt handshake protocol in some cases.
# Bolt v2 negotiation (should succeed)
Client: <open TCP connection>
Client: 60 60 B0 17 # protocol preamble
Client: 00 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 # allowed versions
Server: 00 00 00 01 # chosen version
# Bolt v4 negotiation (should fail)
Client: <open TCP connection>
Client: 60 60 B0 17 # protocol preamble
Client: 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 # allowed versions
Server: 00 00 00 03 # chosen version
I've filed a support ticket with GrapheneDB describing this problem.
Recently, I try "neo4rs"," Deadpool-bolt", "b88-bolt" to create connection pool with neo4j. My program appears
"error:UnexpectedMessage("unexpected response for RUN: Err(IOError { detail: "IO driver has terminated" })")"driver has terminated"
when many query appears in a short time. How to solve it ?
I have google the error , but I did not found any useful information.
First of all, thanks for creating these crates!
But currently there seems to be a difference between the bolt-client code on docs.rs and this repo even though both have them same version and only the code from here actually builds.
Hello!
This might be the wrong channel for a meta question, but I didn't find any other possibility to contact you. Did you reverse engineer the bolt version 4 specs? Or do you have any official source?
Thanks in advance!
error[E0433]: failed to resolve: could not find `CommunicationError` in `error`
--> /home/flip111/.cargo/registry/src/github.com-1ecc6299db9ec823/bolt-client-0.9.1/src/client/v1.rs:26:5
|
26 | #[bolt_version(1, 2)]
| ^^^^^^^^^^^^^^^^^^^^^ could not find `CommunicationError` in `error`
|
= note: this error originates in the attribute macro `bolt_version` (in Nightly builds, run with -Z macro-backtrace for more info)
Not sure how to fix this. Possibly a bug in this library ?
rustc 1.57.0 (f1edd0429 2021-11-29)
Does the bolt client support routing so it can be used to connect to a Neo4j cluster?
Thank you very much for open sourcing this. This is definitely useful. Is it possible that a usage example being provided for this library?
I tried to make the example here to work, but keep getting errors like the following:
let stream = BufStream::new(stream).compat();
| -------------- ^^^^^^ the trait `std::io::Read` is not implemented for `bolt_client::Stream`
| |
| required by a bound introduced by this call
currently I have this in my cargo.toml file:
bufstream = "0.1"
bolt-client = {version = "0.10.0", features = ["tokio-stream"]}
and I have imports like this:
use bolt_client::*;
use bufstream::BufStream;
use bolt_proto::{message::*, value::*, version::*, Message, Value};
Not sure whether my cargo or import statements are correct. Would be great if a full example can be provided.
Hi! This family of crates looks great and I have a couple of questions about your "production readiness" warnings:
I'd love to be able to use this in some smaller projects for my day job and am looking to help out in any way I can. Thanks again for all the work you've done for this!
Hi mate,
I am Noah, a Rust developer, and I am trying to reach out to you to ask you something about the crate atmos
that you own. Please reply at [email protected] that would really mean a lot to me and my project.
Thanks in advance,
Noah dev@noahpn
Currently the PullAll and Pull messages return a Vec
of results instead of some form of iterator. This means that it is not possible to write streaming algorithms against older versions of Neo4j. Additionally, as the low-level read_message
and send_message
are only pub(crate)
it isn't possible to implement this behaviour as a consumer.
In the case of Pull, this is probably fine as the user can specify a low n
value to stream over results, but it might be worth changing both APIs to match anyway.
Currently there does not appear to be an easy way to serialize the Record structs and the Values they contain. My current work around is to manually convert the Bolt Values to Serde JSON Values, but it seems a bit clunky. I believe adding support for serialization/deserialization with Serde would be beneficial to this library.
i found an issue updated at 2021, i would like to use ROUTE with deadpool bolt: [(https://docs.rs/bolt-client/latest/bolt_client/struct.Client.html#method.route)]
Can you provide an example of how to use it with a cluster?
Thanks.
Hey, I'm currently researching a new tech stack for a new project and bolt-rs seems to be the only active library for rust->neo4j.
Is there a rough ETA on support for the newest Neo4j version (4)?
Would be great to be able to use Rust for a real life project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.