How do I convert the following SQL query to GORM?
SELECT * FROM files WHERE tsv @@ plainto_tsquery('lexeme word');
Or equivalently:
SELECT * FROM files, plainto_tsquery('lexeme word') q WHERE tsv @@ q;
I can use .Exec():
err := d.Connection.DB.Exec("SELECT * FROM scenes WHERE tsv @@ plainto_tsquery(?);",text).Error
if err != nil {
return nil, err
}
This query doesn't allow me to get an array of data and work with it. Unfortunately, I could not find a solution using the GORM documentation.