-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Adding mssql support. #3772
Adding mssql support. #3772
Conversation
Rebased onto master, when editing LDAP authentication configuration it gives a 500 internal server error, logs show
Workaround is editing the JSON in the table directly. With an organization created, viewing the dashboard gives
|
For the second part, It appears xorm doesn't transparently shift between LIMIT/TOP, as limit is not supported in SQL server. Not knowing xorm/go very well, should an issue be raised there?, or is it the responsibility of gogs to detect the DB and translate queries?. EDIT: I was wrong. Apparently gogs is using raw SQL in models/org.go:497. This section uses a hardcoded LIMIT query. (With a todo suggestion using the xorm builder) |
@dlob.! awesome. From my testing the only other issue is the hardcoded limit expression, which is an easy change for someone who knows xorm. Everything else I've encountered are already tracked/not related to mssql support. EDIT: I tried cloning the changes to xorm and rebuilding, the error still occurs in gogs. |
@btrepp Did you create a new database? The fix does not work with already existing dbs out of the box, because the type definition of the 'cfg' column of the 'login_source' table has changed to varchar(max) instead of text. Otherwise you could do this change manually. |
Hi, I have merged go-xorm/xorm#499 and push some commits for mssql support. |
Any update on whether this is going to get merged? |
@johnharris85 I have to install a SQL server to test it, not easy on a Mac, need download and setup a Windows. |
OK cool. I might be able to help in the next day or so (on Linux but have a Windows box hanging around somewhere I'm sure). |
@johnharris85: mssql is also available for Linux if that helps. |
I'm using MSSQL for Linux and failed with:
|
@unknwon Did you create a database first? I was able to reproduce the error when no database has been created and mssql uses the default 'master' database. If you create a database (e.g. 'gogs'), it works. I tested this also with MSSQL for Linux running inside Docker. There is definitely a need of improvement regarding error handling and error messages in xorm/mssql-driver. |
Ah.. stupid me! I'll test again. 😓 |
Succeed. BTW, any recommendations of Mac MSSQL client? |
@unknwon I only know this one: https://docs.microsoft.com/en-us/sql/connect/odbc/linux/connecting-with-sqlcmd |
Thanks for the link! But I wasn't clear about my question... I'll try google with some GUI clients... |
This pull request adds support for mssql (Microsoft SQL Server) databases.
It depends on a pull request to xorm (go-xorm/xorm#469), which is mandatory to get mssql support for gogs without fundamental changes.