pg_interval

Crates.iopg_interval
lib.rspg_interval
version0.4.2
sourcesrc
created_at2018-08-06 20:42:57.989008
updated_at2022-10-20 01:06:23.201526
descriptionA native PostgreSQL interval type
homepage
repositoryhttps://github.com/piperRyan/rust-postgres-interval
max_upload_size
id77803
size67,113
(piperRyan)

documentation

README

Build Status codecov

Rust-Postgres-Interval

A interval type for the postgres driver.

Contributing

There is a separate document on how to contribute to this repo here

Overview

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);
}

Requirements

  • rust 1.22

Roadmap to 1.0.0

  • Convert Interval Into Formated String
    • Iso 8601
    • Postgres
    • Sql
  • Parse Formated Strings Into The Interval Type
    • Iso 8601
    • Postgres
    • Sql
  • Chrono Integrations
Commit count: 118

cargo fmt