Skip to content
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

fix(contrib/drivers/mssql): update tables SQL query for better compatibility #4170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

li-zheng-hao
Copy link

修复gf gen在sqlserver上的异常问题:

  1. gf gen dao 连接sqlserver 生成dao出错 对象名 'SYSOBJECTS' 无效 #1722
  2. mssql: 对象名 'SYSOBJECTS' 无效 大小写问题 #1761
> gf gen dao
fetching tables failed: SELECT NAME FROM SYSOBJECTS WHERE XTYPE='U' AND STATUS >= 0 ORDER BY NAME: mssql: 对象名 
'SYSOBJECTS' 无效。
1. SELECT NAME FROM SYSOBJECTS WHERE XTYPE='U' AND STATUS >= 0 ORDER BY NAME
2. mssql: 对象名 'SYSOBJECTS' 无效。

在SqlServer 2022已测试通过:

image

@gqcn
Copy link
Member

gqcn commented Feb 27, 2025

@li-zheng-hao 你好,我没有在mssql 2022上复现这个问题。如果该问题确实存在,需要提交对应的gf gen dao的单测来覆盖你的修改,保证结果如预期。单测的编写请参考cmd/gf下已有的单测代码:https://github.com/gogf/gf/blob/master/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@li-zheng-hao Hello, I did not reproduce this problem on mssql 2022. If this problem does exist, you need to submit a corresponding single test of gf gen dao to cover your modifications and ensure that the results are as expected. For writing single tests, please refer to the existing single test code under cmd/gf: https://github.com/gogf/gf/blob/master/cmd/gf/internal/cmd/cmd_z_unit_gen_dao_test.go

@gqcn gqcn added missing unit testing cases Used in PR, the associated unit testing cases should be committed. and removed need more details labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing unit testing cases Used in PR, the associated unit testing cases should be committed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants