Describe the feature

Support the Sqlite INDEXED BY clause when using the UseIndex hint.

https://www.sqlite.org/lang_indexedby.html https://gorm.io/docs/hints.html

Motivation

I have a service that uses MySql driver for prod and Sqlite driver for testing. One of my queries uses the UseIndex hint, that adds the USE INDEX clause to the query, which isn't supported by Sqlite. I'd like to be able to inject different versions of gorm(mysql/sqlite) and use the UseIndex hint without having to add a flag for the specific type of driver used.

Related Issues

Comment From: jwendel

Digging around, looks like the hint library has not gotten very much attention:

https://github.com/go-gorm/hints/commits/master/index_hint.go

I can sort of understand why, as Postgres ignores them, and the impl here works for MySQL. The code doesn't look too complicated, but I'm not sure how Gorm deals with query differences between DBs in cases like this.