5cdf1cc00dc201c07e6f343cf1fdea2fd23a43fb
WithVirtual(bool) 只是给 New() 打一个标记位,虚拟资源需要的表达式(子查询)没有 承载的地方,之前借用 table string 字段硬拼字符串。改成 NewVirtualResource(res, code, table, opts...) 专门构造:table 参数直接接收 exp.SQLExpression, GetTableExpr 对虚拟资源直接用它生成子查询表达式,不用再手工拼括号和字符串; container/conn/historyRoles 从传入的父资源上直接复用。 GetTableExpr 返回值类型从 exp.LiteralExpression 放宽成 exp.Aliaseable, 兼容 db.T(...)(IdentifierExpression)和 db.L(...)(LiteralExpression)两种 返回值。
Description
No description provided
212 KiB
Languages
Go
100%