Ecto
モジュールでsql apiを使用するとき、変数を使う場合は^
(pin operator)が必要になる。
^
をつけると、その値はエスケープ処理される。last_name = "Smith"
Friends.Person |> Ecto.Query.where(last_name: ^last_name) |> Friends.Repo.all # ^が必要
Friends.Person |> Ecto.Query.where(last_name: "namiki") |> Friends.Repo.all # ^が不要
https://hexdocs.pm/ecto/getting-started.html#filtering-results https://github.com/elixir-ecto/ecto/issues/180