There's no way to do the use more sophisticated DB features because there's no way to do the following
from(f in File, where: f.id == ^record.id)
|> MyApp.Repo.update_all(set: [search_vector: fragment("to_tsvector('simple', coalesce(unaccent(?), ''))", keywords)])
There's a way to pass fragment to the update.
Which error do you get?
AFAIR undefined function fragment
That is because update_all is not a macro and does not allow for query syntax.
You can use that, though with update: keyword for from:
query =
from f in File, where: f.id == ^record_id, update: [set: [foo: fragment("...")]]
Repo.update_all(query, [])
An example in the docs for that would be great!
I can handle this issue, if y'all give the go ahead. :-)
Please go ahead :D
Ready for review, friends!
:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart:
Most helpful comment
:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart: