-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
database/gdb: In the transaction, the Schema method does not take effect and the corresponding table structure cannot be obtained correctly. #3876
Comments
It should not be considered a bug. I have seen the [reply] of this issue #3820 before (#3820 (comment)) |
@UncleChair 如果不支持跨库,能直接用.model(tableName) 和data 拼接sql也行呀,现在是如果没查到表字段直接报错,至少是希望如果没查到表字段,直接使用data里面的key,表明直接使用 传的tableName. |
@UncleChair If cross-database support is not supported, you can directly use .model(tableName) and data to splice sql. Now, if the table field is not found, an error will be reported directly. At least I hope that if the table field is not found, you can directly use the data in the data. key, indicating that the passed tableName is used directly. |
@yimuysl001 你好,我理解数据库应该本身不支持跨库的?所以 |
@yimuysl001 Hello, I understand that the database itself does not support cross-database? Therefore, |
Go version
go1.20.14 windows/amd64
GoFrame version
2.7.4
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
复现bug代码:
1.表结构
2.使用tx事务问题
3.使用ctx 事务
Schema在Model前面
What did you see happen?
如果数据涉及到分库分表,需要在一个数据源跨库进行数据增删改查的操作,目前使用gdb的事务,一个事务只能在一个库中进行操作,无法有效获取数据源其他库的表结构,无法保存数据
What did you expect to see?
希望能在事务中提供类似Schema的方法,让数据能够正常处理;或者提供一个方法,如果没查到表结构,使用需要提交map的key来做数据的字段(目前是直接报错,无法在model(aaa..bbb)的方式强制切换库)
The text was updated successfully, but these errors were encountered: