Your Question
I am trying to force an index following https://cloud.google.com/spanner/docs/secondary-indexes#index-directive for PostgreSQL and it requires a /*@ FORCE_INDEX = AlbumsByAlbumTitle */ comment before the where clause. However it needs to be in that exact format with the /*@.
However if I do something like this hints.CommentBefore("where", "FORCE_INDEX = idx_schemas_hash") . It generates a query like so SELECT * FROM "schemas" /* FORCE_INDEX = idx_schemas_hash */ WHERE hash = 'd228cb69721a8caf78912b704e4a8d15' AND "schemas"."deleted_at" IS NULL ORDER BY "schemas"."id" LIMIT 1 and it doesn't seem to be a way to make the comment start with /*@.
The document you expected this should be explained
Looking though https://gorm.io/docs/sql_builder.html#Clauses and https://gorm.io/docs/hints.html#content-inner there doesn't seem to be a way to do this.
Expected answer
A way to specify comment start and end characters.
Comment From: a631807682
You can change the Prefix yourself https://github.com/go-gorm/hints/blob/master/hints.go#L81