postgres 表名含点号 #1791

Open
opened 2020-09-11 05:55:09 +00:00 by ryanvin · 1 comment

postgres 数据库, 表名例如是 order.p1, schema 是public, 完整的 fromStr 应该是 "public"."order.p1", 这个在postgres数据库是可以的, 目前 xorm 在Quote()方法里将. 全部加了prefix和sufix, "order.p1" 变成了 "order"."p1", 导致出错.

请问是否考虑fix这个问题

postgres 数据库, 表名例如是 order.p1, schema 是public, 完整的 fromStr 应该是 "public"."order.p1", 这个在postgres数据库是可以的, 目前 xorm 在Quote()方法里将`.` 全部加了prefix和sufix, "order.p1" 变成了 "order"."p1", 导致出错. 请问是否考虑fix这个问题
lunny added the
kind
bug
label 2020-09-11 07:12:33 +00:00
Member

这个似乎不好处理
两个场景
"public"."order.p1"
"order"."p1"

不好判定用户具体是什么场景

增加TableName同级的interface不知是否可行

type SchemaName interface {
	SchemaName() string
}

这个似乎不好处理 两个场景 "public"."order.p1" "order"."p1" 不好判定用户具体是什么场景 增加TableName同级的interface不知是否可行 ``` type SchemaName interface { SchemaName() string } ```
caoyong started working 2020-10-10 07:52:07 +00:00
caoyong canceled time tracking 2020-10-10 07:52:13 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1791
No description provided.