【问题标题】:Does Diesel support the Postgres `point` type?Diesel 是否支持 Postgres `point` 类型?
【发布时间】:2018-05-09 10:16:30
【问题描述】:

我想使用point Postgres 类型。我没有在 Diesel 的类型列表中看到 here 列出的这种类型。

编写包含point 列的模型的正确方法是什么?

【问题讨论】:

标签: rust rust-diesel


【解决方案1】:

基于this Diesel GitHub issue 以及diesel::pg::typesdiesel::types 中可用的类型,似乎不支持这些类型。

要编写一个包含 point 列的模型,您需要将 point 设为 Diesel 可以理解的值。首先为Point 类型实现FromSql 特征,然后实现所有需要的东西。对于这样的扩展,请查看this PR

【讨论】:

    猜你喜欢
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-26
    • 2016-08-20
    • 2016-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多