go-gorm / sqlite

GORM sqlite driver
MIT License
179 stars 184 forks source link

fix: double quoted string literals in migrator #183

Closed ncruces closed 8 months ago

ncruces commented 9 months ago

What did this pull request do?

Using %q is not appropriate to quote a string literal in RAW SQL. Double-quoted strings are considered a misfeature of SQLite, and advised to be disabled at compile time. Also, %q produces the wrong quoting: Hi "GORM"! is quoted as "Hi \"GORM\"!" not "Hi ""GORM""!", as SQLite would expect.

Current head fails GORM TestMigrateWithUniqueIndexAndUnique if SQLite is configured with SQLITE_DQS=0.

User Case Description