Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jordan0day/couchdb-ex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CouchDBEx

Build Status Coverage Status Hex.pm

This is supposed to be a good couchdb interface for elixir, documented, tested and other things, that's in progress for now, i know there are erlang and elixir clients already, but they are basically dead and not documented very good if at all, although you might also want to look at icouch

Some features implemented:

  • Single and mass document insertion/deletion/update
  • Subscribing to changes in the database
  • Basic and cookie authentification
  • Database configuration retreival and setting
  • Document finding
  • Attachment uploading/retreival/deletion
  • Index creation/deletion/listing
  • Replication

Documentation can be found here

Usage example

First, add the couchdb worker to your supervisor

    children = [
      {CouchDBEx.Worker, [
          hostname: "http://localhost",
          basic_auth_username: "couchdb",
          basic_auth_password: "couchdb"
        ]}
    ]

    opts = [strategy: :one_for_one, name: Application.Supervisor]
    Supervisor.start_link(children, opts)

Then, you use functions from CouchDBEx

:ok = CouchDBEx.db_create("couchdb-ex-test")

{:ok, doc} = CouchDBEx.document_insert_one("couchdb-ex-test", %{test_value: 1})

This library also includes subscribing to database changes with CouchDBEx.changes_sub and _ubsub, see respective functions documentation for more

Contribution

Please do open issues and pull requests if you feel like something is wrong, this library probably doesn't have everything you need yet.

About

Elixir CouchDB driver

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%