7 releases (4 breaking)

0.4.2 Oct 20, 2022
0.4.1 Feb 23, 2022
0.3.0 May 5, 2019
0.2.0 Apr 1, 2019
0.0.1 Aug 6, 2018

#574 in Database interfaces

Download history 1285/week @ 2024-12-08 1130/week @ 2024-12-15 717/week @ 2024-12-22 913/week @ 2024-12-29 1501/week @ 2025-01-05 1537/week @ 2025-01-12 1492/week @ 2025-01-19 1074/week @ 2025-01-26 1542/week @ 2025-02-02 1483/week @ 2025-02-09 1565/week @ 2025-02-16 1625/week @ 2025-02-23 1811/week @ 2025-03-02 1665/week @ 2025-03-09 1552/week @ 2025-03-16 1547/week @ 2025-03-23

6,650 downloads per month
Used in 4 crates (3 directly)

MIT license

67KB
1.5K SLoC

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

Dependencies

~1.1–2.2MB
~38K SLoC