7 个版本 (4 个破坏性更新)

0.4.2 2022年10月20日
0.4.1 2022年2月23日
0.3.0 2019年5月5日
0.2.0 2019年4月1日
0.0.1 2018年8月6日

#550数据库接口

Download history • Rust 包仓库 5039/week @ 2024-03-14 • Rust 包仓库 4468/week @ 2024-03-21 • Rust 包仓库 5365/week @ 2024-03-28 • Rust 包仓库 4121/week @ 2024-04-04 • Rust 包仓库 4663/week @ 2024-04-11 • Rust 包仓库 4641/week @ 2024-04-18 • Rust 包仓库 3641/week @ 2024-04-25 • Rust 包仓库 2811/week @ 2024-05-02 • Rust 包仓库 3410/week @ 2024-05-09 • Rust 包仓库 3224/week @ 2024-05-16 • Rust 包仓库 2722/week @ 2024-05-23 • Rust 包仓库 1936/week @ 2024-05-30 • Rust 包仓库 1941/week @ 2024-06-06 • Rust 包仓库 1649/week @ 2024-06-13 • Rust 包仓库 1341/week @ 2024-06-20 • Rust 包仓库 1029/week @ 2024-06-27 • Rust 包仓库

6,422 每月下载量
3 个 Crates 中使用 (2 个直接使用)

MIT 许可证

67KB
1.5K SLoC

Build Status codecov

Rust-Postgres-Interval

为 postgres 驱动提供的时间间隔类型。

贡献

有关如何为此仓库做出贡献的单独文档 在此

概述

Rust-Postgres-Interval 是为 postgres 时间间隔类型专门的数据类型。

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

要求

  • rust 1.22

1.0.0 版本路线图

  • 将时间间隔转换为格式化字符串
    • Iso 8601
    • Postgres
    • Sql
  • 将格式化字符串解析为时间间隔类型
    • Iso 8601
    • Postgres
    • Sql
  • Chrono 集成

依赖

~1–1.8MB
~33K SLoC