Git Product home page Git Product logo

rusted-cypher's People

Contributors

afldcr avatar flosse avatar lhkastenson avatar livioribeiro avatar pnathan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rusted-cypher's Issues

"error: custom derive attribute panicked" compiling new project

(Forgive me if this is something obvious, this is literally my first Rust project.)

Steps to reproduce:

  1. create a new library project foo with cargo new
  2. cd to the project
  3. add rusted-cypher with cargo add
  4. cargo build

Expected:

  • project compiles

Actual:

  • compilation fails with "error: custom derive attribute panicked"
$ cargo new foo
     Created library `foo` project
$ cd foo
$ cargo add rusted_cypher 
$ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling rustc-serialize v0.3.22
   Compiling regex-syntax v0.3.9
   Compiling winapi-build v0.1.1
   Compiling httparse v1.2.1
   Compiling serde v0.9.10
   Compiling itoa v0.3.1
   Compiling log v0.3.6
   Compiling dtoa v0.4.1
   Compiling libc v0.2.21
   Compiling unicode-normalization v0.1.4
   Compiling mime v0.2.2
   Compiling num-traits v0.1.37
   Compiling winapi v0.2.8
   Compiling utf8-ranges v0.1.3
   Compiling time v0.1.36
   Compiling memchr v0.1.11
   Compiling unicode-xid v0.0.4
   Compiling synom v0.11.3
   Compiling aho-corasick v0.5.3
   Compiling quick-error v1.1.0
   Compiling lazy_static v0.2.2
   Compiling typeable v0.1.2
   Compiling traitobject v0.1.0
   Compiling matches v0.1.4
   Compiling kernel32-sys v0.2.2
   Compiling unicode-bidi v0.2.5
   Compiling quote v0.3.14
   Compiling num_cpus v1.3.0
   Compiling semver v0.1.20
   Compiling language-tags v0.2.2
   Compiling thread-id v2.0.0
   Compiling thread_local v0.2.7
   Compiling syn v0.11.8
   Compiling rustc_version v0.1.7
   Compiling idna v0.1.0
   Compiling unicase v1.4.0
   Compiling hyper v0.10.5
   Compiling regex v0.1.80
   Compiling url v1.4.0
   Compiling serde_codegen_internals v0.14.1
   Compiling serde_json v0.9.8
   Compiling serde_derive v0.9.10
   Compiling semver-parser v0.6.2
   Compiling semver v0.5.1
   Compiling rusted_cypher v1.0.0
error: custom derive attribute panicked
   --> /Users/dmoles/.cargo/registry/src/github.com-1ecc6299db9ec823/rusted_cypher-1.0.0/src/cypher/transaction.rs:115:17
    |
115 | #[derive(Debug, Deserialize)]
    |                 ^^^^^^^^^^^
    |
    = help: message: assertion failed: !p.is_null()

error: Could not compile `rusted_cypher`.

To learn more, run the command again with --verbose.

Running again with --verbose doesn't provide any more error output, just the full rustc commands. The cause is given as:

  process didn't exit successfully: `rustc --crate-name rusted_cypher /Users/dmoles/.cargo/registry/src/github.com-1ecc6299db9ec823/rusted_cypher-1.0.0/src/lib.rs --crate-type lib -g -C metadata=6d3ed2b8fc0765f2 -C extra-filename=-6d3ed2b8fc0765f2 --out-dir /Users/dmoles/foo/target/debug/deps --emit=dep-info,link -L dependency=/Users/dmoles/foo/target/debug/deps --extern serde_derive=/Users/dmoles/foo/target/debug/deps/libserde_derive-33957e402d840a76.dylib --extern quick_error=/Users/dmoles/foo/target/debug/deps/libquick_error-131bda12920364f4.rlib --extern log=/Users/dmoles/foo/target/debug/deps/liblog-1ce22d3a92f37841.rlib --extern serde_json=/Users/dmoles/foo/target/debug/deps/libserde_json-d68cb7971985091c.rlib --extern serde=/Users/dmoles/foo/target/debug/deps/libserde-dac34a4e26465874.rlib --extern semver=/Users/dmoles/foo/target/debug/deps/libsemver-58ba1dc30195eb36.rlib --extern time=/Users/dmoles/foo/target/debug/deps/libtime-53238cb92943b947.rlib --extern hyper=/Users/dmoles/foo/target/debug/deps/libhyper-a893baf9128f9685.rlib --cap-lints allow` (exit code: 101)

This is on macOS 10.11.6 with rustc 1.15.1 and cargo 0.16.0-dev.

Incompatibility with Serde 1.0.0

After updating to the recently released 1.0.0 version of serde, serde_json, and serde_derive, I'm getting errors of this kind:

`the trait `rusted_cypher::<unnamed>::Serialize` is not implemented for `{struct name here}``

Not thread safe

The way that the graph headers is implemented means that the crate is not thread safe.

My quick solution is not to connect to neo4j in the main program, but instead to connect inside the threads. It means there is no connection pooling.

No method 'query' found

I have this code from the examples

let graph = GraphClient::connect("http://neo4j:neo4j@localhost:7474/db/data");
let mut query = graph.query();

and I'm getting this error

error[E0599]: no method named query found for type std::result::Result<rusted_cypher::GraphClient, rusted_cypher::GraphError> in the current scope
--> src/main.rs:3342:27
|
3342 | let mut query = graph.query();
| ^^^^^

rustc_serialize support

At the moment the library forces the user to use serde to deserialize the data. That implies a project which depends on rusted-cyper can't compile with the stable compiler unless it implements the trait for each struct or use the "syntex hack".
Could we provide a function like

pub fn get_rustc<T: rustc_serialize::Decodable>(&self, column: &str) -> Result<T, GraphError>

at least as long as rust doesn't accept compiler plugins within stable releases?

docs

Great project! Would you mind to publish the docs anywhere?

r2d2 support

I started with a first snippet to use your library with r2d2: https://github.com/flosse/r2d2-cypher.
Do you have an idea how I can check if the connection of the GraphClient is still alive? Is there a cypher query that always works with minimal payload?

working with NULL

Cypher does not allow to use null as parameter type. Unfortunately a serialized struct with a Option<T> field contains null values.
So e.g. this would fail:

struct Foo {
  id:  Option<u32>,
  name: String
}
let x = Foo{id: None, name: "foo".to_string()};
graph.cypher()
  .exec(cypher_stmt!("CREATE (e:Entry {entry}) RETURN e.id" {
  "entry" => &x }))

Do you have a recommendation for handling such a case?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.