| Crates.io | pg_interval |
| lib.rs | pg_interval |
| version | 0.4.2 |
| created_at | 2018-08-06 20:42:57.989008+00 |
| updated_at | 2022-10-20 01:06:23.201526+00 |
| description | A native PostgreSQL interval type |
| homepage | |
| repository | https://github.com/piperRyan/rust-postgres-interval |
| max_upload_size | |
| id | 77803 |
| size | 67,113 |
A interval type for the postgres driver.
There is a separate document on how to contribute to this repo here
Rust-Postgres-Interval is dedicated datatype for the postgres interval type.
extern crate pg_interval;
use pg_interval::Interval;
fn main() {
let interval = Interval::from_postgres(
"1 years 1 months 1 days 1 hours"
).unwrap();
let output = interval.to_iso_8601();
assert_eq!(String::from("P1Y1M1DT1H"), output);
}