Closed brezal closed 8 years ago
Currently there is no way to run such operations via Ecto DSL.
You may want to use RethinkDB.run/2
which is available as shortcut in your repository:
defmodule MyApp.Repo do
use Ecto.Repo, otp_app: :my_app
end
import RethinkDB.Query
feed =
table("users")
|> changes
|> MyApp.Repo.run
This is not perfect, and in future it may be possible to use Ecto.Schema
to run such queries:
import RethinkDB.Query
feed =
MyApp.User
|> MyApp.Repo.changes
|> MyApp.Repo.run
or even
import RethinkDB.Query
feed =
from(u in MyApp.User, where: u.age > 18)
|> MyApp.Repo.changes
|> MyApp.Repo.run
Hi @almightycouch! Thanks for putting this together. What are your thoughts on working with changefeeds, geospatial queries, and other RethinkdDB specific operations?