clickhouse-rs icon indicating copy to clipboard operation
clickhouse-rs copied to clipboard

Can't get examples to complie

Open olegantonyan opened this issue 4 years ago • 1 comments

Trying this example: https://github.com/suharev7/clickhouse-rs/blob/master/examples/simple.rs

error[E0463]: can't find crate for `futures`
 --> src/main.rs:2:1
  |
2 | extern crate futures;
  | ^^^^^^^^^^^^^^^^^^^^^ can't find crate

Adding futures = "*" to Cargo.toml doesn't help much:

error[E0433]: failed to resolve: use of undeclared type or module `env_logger`
  --> src/main.rs:12:5
   |
12 |     env_logger::init();
   |     ^^^^^^^^^^ use of undeclared type or module `env_logger`

error[E0433]: failed to resolve: use of undeclared type or module `tokio`
  --> src/main.rs:48:5
   |
48 |     tokio::run(done)
   |     ^^^^^ use of undeclared type or module `tokio`

olegantonyan avatar Mar 23 '20 05:03 olegantonyan

extern crate env_logger;

and

[dependencies]
clickhouse-rs = "*"
futures = "*"
tokio = "*"
env_logger = "*"

seems to work

olegantonyan avatar Mar 23 '20 05:03 olegantonyan