auraphp / Aura.SqlQuery

Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
MIT License
452 stars 86 forks source link

how to execute a query using: USE INDEX? #192

Open suvarivaza opened 2 years ago

suvarivaza commented 2 years ago

SELECT * FROM table1 USE INDEX (col1_index,col2_index)

anoxia commented 7 months ago

use fromRaw(), for example:

(new QueryFactory(self::Type))
    ->newSelect()
    ->fromRaw("`{$table}` FORCE INDEX (index_name)")
    ->cols($columns)
    ...