I created an extension for handling MySQL's FIELD function, would that be valuable as a PR? As far as I can tell, there's no parallel functions in the other RDBMSes (although it could maybe be faked with a CASE statement?), so I'm not sure if there's a way to handle non-universally supported functions, or a desire for them in this gem.
ids = [1, 2, 3, 4, 5]
Post.order(Post[:id].field(ids)).to_sql
=> "SELECT `posts`.* FROM `posts` ORDER BY FIELD(`posts`.`id`, 1, 2, 3, 4, 5)"
I created an extension for handling MySQL's
FIELDfunction, would that be valuable as a PR? As far as I can tell, there's no parallel functions in the other RDBMSes (although it could maybe be faked with a CASE statement?), so I'm not sure if there's a way to handle non-universally supported functions, or a desire for them in this gem.