3 个版本 (破坏性更新)

0.3.0 2019年2月19日
0.2.0 2019年2月13日
0.1.0 2019年2月8日

#2596数据库接口

MIT 许可证

8KB
149 代码行

diesel-citext  

Diesel 支持 Postgres citext 扩展

使用示例

这个非常小的扩展允许你在不修改 schema.rs 生成的文件的情况下使用 diesel 的 citext 类型。它从 diesel-postgis 中汲取了许多灵感。

在发送到 postgres 和从 postgres 解析后,文本内容始终通过 Rust String to_lowercase 方法传递。

为了确保 schema.rs 文件中的 citext 能够正确解析,请将 diesel_citext 添加到你的 diesel.toml 文件中的 import types 声明中。

例如,它将看起来像这样

[print_schema]
file = "src/schema.rs"

import_types = ["diesel::sql_types::*", "diesel_citext::sql_types::*"]

lib.rs:

Diesel 支持 Postgres citext 扩展

依赖

~2.6–8MB
~152K SLoC