Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Description

{ describe your changes here }

### Checklist
- [ ] Formatted code using `cargo fmt --all`
- [ ] Linted code using clippy `cargo clippy --all-targets --all-features -- -D warnings`
- [ ] Updated README.md using `cargo readme > README.md`
- [ ] Reviewed the diff. Did you leave any print statements or unnecessary comments?
- [ ] Any unfinished work that warrants a separate issue captured in an issue with a TODO code comment
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ matrix:
- binutils-dev
- cmake

- rust: stable
env: NAME='readme-check'
before_script:
- bash auxiliary/update_cargo-readme.sh
script:
- bash auxiliary/check_readme_consistency.sh

script: |
export RUST_BACKTRACE=1 &&
cargo build &&
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ The process described here has several goals:

Please follow these steps to have your contribution considered by the maintainers:

1. Follow all instructions in [the template](PULL_REQUEST_TEMPLATE.md)
1. Follow all instructions in [the template](./.github/PULL_REQUEST_TEMPLATE.md)
2. Follow the [styleguides](#styleguides)
3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details>

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ This library is a work in progress. Although we've been using it in production a
we've prioritized features that fit our use cases. This means a feature you might need is not implemented
yet or could be handled better.

Pull requests are always welcome. See [Contributing](./CONTRIBUTING.md) and [Code of Conduct](./CODE_OF_CONDUCT.md).
Pull requests are always welcome. See [Contributing](https://github.com/Empty2k12/influxdb-rust/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/Empty2k12/influxdb-rust/blob/master/CODE_OF_CONDUCT.md).

## Currently Supported Features
### Currently Supported Features

- Reading and Writing to InfluxDB
- Optional Serde Support for Deserialization
- Running multiple queries in one request (e.g. `SELECT * FROM weather_berlin; SELECT * FROM weather_london`)
- Authenticated and Unauthenticated Connections

## Planned Features
### Planned Features

- Read Query Builder instead of supplying raw queries
- `#[derive(InfluxDbReadable)]` and `#[derive(InfluxDbWriteable)]` proc macros
Expand All @@ -57,13 +57,15 @@ For an example with using Serde deserialization, please refer to [serde_integrat

```rust
use influxdb::{Client, Query, Timestamp};
use serde::Deserialize;
use tokio::runtime::current_thread::Runtime;

// Create a Client with URL `http://localhost:8086`
// and database name `test`
let client = Client::new("http://localhost:8086", "test");

// Let's write something to InfluxDB. First we're creating a `WriteQuery` to write some data.
// Let's write something to InfluxDB. First we're creating a
// WriteQuery to write some data.
// This creates a query which writes a new measurement into a series called `weather`
let write_query = Query::write_query(Timestamp::NOW, "weather")
.add_field("temperature", 82);
Expand All @@ -79,7 +81,7 @@ let write_result = rt.block_on(client.query(&write_query));
assert!(write_result.is_ok(), "Write result was not okay");

// Reading data is as simple as writing. First we need to create a query
let read_query = Query::raw_read_query("SELECT _ FROM weather");
let read_query = Query::raw_read_query("SELECT * FROM weather");

// Again, we're blocking until the request is done
let read_result = rt.block_on(client.query(&read_query));
Expand All @@ -98,4 +100,5 @@ in the repository.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


@ 2019 Gero Gerke, All rights reserved.
32 changes: 32 additions & 0 deletions README.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div align="center">
<br/>
<img
alt="rust-influxdb"
src="https://i.imgur.com/4k7l8XJ.png"
width=250px />
<br/>
<br/>
<strong>Unofficial InfluxDB Driver for Rust</strong>
</div>
<br/>
<p align="center">
<a href="https://crates.io/crates/influxdb">
<img src="https://img.shields.io/crates/v/influxdb.svg"/>
</a>
<a href="https://travis-ci.org/Empty2k12/influxdb-rust">
<img src="https://travis-ci.org/Empty2k12/influxdb-rust.svg?branch=master" alt='Build Status' />
</a>
<a href="https://coveralls.io/github/Empty2k12/influxdb-rust?branch=master">
<img src="https://coveralls.io/repos/github/Empty2k12/influxdb-rust/badge.svg?branch=master" alt='Coverage Status' />
</a>
<a href="https://docs.rs/crate/influxdb">
<img src="https://docs.rs/influxdb/badge.svg" alt='Documentation Status' />
</a>
<a href="https://www.rust-lang.org/en-US/">
<img src="https://img.shields.io/badge/Made%20with-Rust-orange.svg" alt='Build with Rust' />
</a>
</p>

{{readme}}

@ 2019 Gero Gerke, All rights reserved.
14 changes: 14 additions & 0 deletions auxiliary/check_readme_consistency.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

cargo readme > README.md.expected

diff README.md README.md.expected

if [ $? -eq 0 ]
then
echo 'README.md is up to date!'
exit 0
else
echo 'README.md out of date. Run "cargo readme > README.md" and commit again.'
exit 1
fi
11 changes: 11 additions & 0 deletions auxiliary/update_cargo-readme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/bash

our_version=$(cargo readme -V | perl -ne 'print $1 while /v([\d.]+)/g')
last_version=$(cargo search cargo-readme | perl -ne 'print $1 while /^cargo-readme = "([\d.]+)"/g')

if [ "$our_version" == "$last_version" ]; then
echo Version $our_version is of cargo-readme is installed and up to date.
else
echo "Install cargo-readme"
cargo install cargo-readme
fi
13 changes: 9 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Library for talking to InfluxDB
//!
//! This library is a work in progress. Although we've been using it in production at [OpenVelo](https://openvelo.org/),
//! we're prioritized features that fit our use cases. This means a feature you might need is not implemented
//! we've prioritized features that fit our use cases. This means a feature you might need is not implemented
//! yet or could be handled better.
//!
//! Pull requests are always welcome. See [Contributing](https://github.com/Empty2k12/influxdb-rust/blob/master/CONTRIBUTING.md) and [Code of Conduct](https://github.com/Empty2k12/influxdb-rust/blob/master/CODE_OF_CONDUCT.md).
//!
//! ## Currently Supported Features
//!
//! - Reading and Writing to InfluxDB
Expand All @@ -14,7 +14,7 @@
//! ## Planned Features
//!
//! - Read Query Builder instead of supplying raw queries
//! - `#[derive(InfluxDbWritable)]`
//! - `#[derive(InfluxDbReadable)]` and `#[derive(InfluxDbWriteable)]` proc macros
//!
//! # Quickstart
//!
Expand Down Expand Up @@ -66,6 +66,11 @@
//!
//! For further examples, check out the Integration Tests in `tests/integration_tests.rs`
//! in the repository.
//!
//! # License
//!
//! [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
//!

#[macro_use]
extern crate failure;
Expand Down