问题描述
使用这个
createdAt TIMESTAMP AS LocalDateTime NOT NULL,
编译但适配器永远不会在 postgres 中从 localdatetime 转换为 TIMESTAMP。相反,我收到
Exception in thread "AWT-EventQueue-0" org.postgresql.util.PSQLException: ERROR: column "createdat" is of type timestamp without time zone but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
我认为这是一个错误,但我首先在这里询问是否有人在 github 上提交错误报告之前有任何想法。谢谢。
val localDatetimeColumnAdapter = object : ColumnAdapter<LocalDateTime,String> {
override fun decode(databaseValue: String) =
LocalDateTime.parse(databaseValue)
override fun encode(value: LocalDateTime) = value.toString()
kotlin_version = 1.3.41
sqldelight_version = 1.5.0
hikari_cp_version = 4.0.3
postgresql_version = 42.2.20
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)