Describe the feature

通过ctx构建schema.table的表名形式

Motivation

在开发多租户的系统时使用PG数据库, 此时通过schema应用租户隔离, 这时tableName不支持动态改变, 只能使用table方法临时指定,临时指定的表名无法参与诸如 Joins 的sql语句的构建。

是否有类似的实现思路或者改造思路?

Related Issues

Comment From: li-jin-gou

https://gorm.cn/zh_CN/docs/scopes.html https://gorm.cn/zh_CN/docs/conventions.html#TableName 使用 Scope 扩展修改 tableName

Comment From: notech

scope 扩展不支持Joins 等多表操作啊, 且scope也只支持传入db handler。 @li-jin-gou 这里有比较好的最佳实践吗? 或者支持context也可以