sqlx-pg-ext-uint 0.1.1

A Simple Extension for SQLX to support postgres uint128
Documentation
  • Coverage
  • 6.25%
    1 out of 16 items documented0 out of 10 items with examples
  • Size
  • Source code size: 59.26 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 5.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 12s Average build duration of successful builds.
  • all releases: 1m 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tianxiu2b2t

SQLx PostgreSQL UINT128 扩展支持

为 SQLx 添加 PostgreSQL pg-uint128 扩展的无符号整数类型支持

功能说明

本扩展为 SQLx 添加了对 PostgreSQL pg-uint128 扩展的完整支持:

  • ✅ 支持所有无符号整数类型读取转换:
    u8, u16, u32, u64, u128, usize
    
  • ⚡ 自动处理数据库的 uint128 类型与 Rust 原生类型转换
  • 🛡️ 包含边界检查防止数据溢出

快速使用

添加依赖

[dependencies]

sqlx = { version = "*", features = ["postgres"] }

sqlx-pg-ext-uint = "0.1"

代码示例

TODO

运行示例

  1. 创建数据库并启用 pg_uint128 扩展
  2. 配置数据库连接字符串
  3. 执行 cargo run

技术说明

  • 支持直接读取为 Rust 原生整数类型
  • 自动验证数值范围(如 u8 值超过 255 会报错)
  • usize 类型会根据目标平台自动处理

许可证