ICouch v0.1.0 ICouch.DB View Source
Holds information about CouchDB databases.
Link to this section Summary
Functions
Internal function that checks if a database exists
Initialize a DB struct
Invokes an arbitrary CouchDB API call on a database which may or may not be implementation specific
Invokes an arbitrary CouchDB API call on a database which may or may not be implementation specific
Internal function to build a server endpoint
Link to this section Types
Link to this section Functions
Link to this function
exists(db)
View Source
exists(db :: t) :: {:ok, t} | {:error, ICouch.RequestError.well_known_error | term}
Internal function that checks if a database exists.
Link to this function
new(server, name)
View Source
new(server :: ICouch.Server.t, name :: String.t) :: t
Initialize a DB struct.
Link to this function
send_raw_req(db, endpoint, method \\ :get, body \\ nil, headers \\ [], ib_options \\ [])
View Source
send_raw_req(db :: t, endpoint :: ICouch.Server.endpoint, method :: ICouch.Server.method, body :: term, headers :: [{binary, binary}], ib_options :: Keyword.t) :: {:ok, {response_headers :: [{binary, binary}], body :: binary}} | {:ibrowse_req_id, id :: term} | {:error, ICouch.RequestError.well_known_error | term}
Invokes an arbitrary CouchDB API call on a database which may or may not be implementation specific.
Link to this function
send_req(db, endpoint, method \\ :get, body \\ nil)
View Source
send_req(db :: t, endpoint :: ICouch.Server.endpoint, method :: ICouch.Server.method, body :: term) :: {:ok, body :: term} | {:error, ICouch.RequestError.well_known_error | term}
Invokes an arbitrary CouchDB API call on a database which may or may not be implementation specific.
Link to this function
server_endpoint(d_b, endpoint)
View Source
server_endpoint(db :: t, endpoint :: ICouch.Server.endpoint) :: URI.t
Internal function to build a server endpoint.
Basically prepends the database name to the given URL path segment.