go-gorm / gorm

The fantastic ORM library for Golang, aims to be developer friendly
https://gorm.io
MIT License
36.52k stars 3.91k forks source link

Remove double quotes from generated SQL to support lowercase table and column names #7133

Closed blatwo closed 2 weeks ago

blatwo commented 1 month ago

I have a feature request regarding the SQL generated by GORM. Currently, GORM encloses table and column names in double quotes. This behavior can be problematic when working with databases that treat unquoted identifiers as case-insensitive and convert them to lowercase.

Problem In my code, I use camelCase or mixed case for table and column names, which is a common practice in Go. However, GORM's generated SQL includes double quotes around these identifiers, which makes them case-sensitive. This results in issues when interacting with databases that expect lowercase identifiers when quotes are absent.

github-actions[bot] commented 1 month ago

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.ioSearch Before Asking