Skip to content

bessey/ecto-rethinkdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: This does not do what it says on the tin yet. It is currently WIP migrating this to a new RethinkDB adapter that supports 2.0

Rethinkdb adapter for Ecto

This is a simple adapter to use Rethinkdb in Ecto.

Installation

Add the following to your list of dependencies in mix.exs:

{ :'ecto-rethinkdb', github: "azukiapp/ecto-rethinkdb" }

Usage

defmodule Repo do
  use Ecto.Repo, adapter: Ecto.Adapters.Rethinkdb

  def url do
    "rethinkdb://localhost/ecto_simple"
  end
end

defmodule Weather do
  use Ecto.Model

  queryable "weather" do
    field :city,    :string
    field :temp_lo, :integer
    field :temp_hi, :integer
    field :prcp,    :float, default: 0.0
  end
end

defmodule Simple do
  import Ecto.Query

  def sample_query do
    query = from w in Weather,
          where: w.prcp > 0 or w.prcp == nil,
         select: w
    Repo.all(query)
  end
end

License

"Azuki" and the Azuki logo are copyright (c) 2013 Azuki Serviços de Internet LTDA..

Rethinkdb Ecto Adapter source code is released under Apache 2 License.

Check LEGAL and LICENSE files for more information.

About

RethinkDB 2.0 adapter for Ecto

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%