Giter VIP home page Giter VIP logo

couchdb_connector's People

Contributors

leifg avatar mkrogemann avatar morsicus avatar waffle-iron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

couchdb_connector's Issues

key parameters for view queries are not UrlEscaped

I have a view which has sorted phone numbers, keys with "+" don't work. Should the connector provide URLescaping of parameters by default?

This doesn't work: It returns 0 results.

{:ok, result} = Couchdb.Connector.View.document_by_key(db, "test_queries", "by_phone_number", "+358123456789")

GET /test_users/_design/test_queries/_view/by_phone_number?key="+358123456789"&stale=update_after 200

This works:

{:ok, result} = Couchdb.Connector.View.document_by_key(db, "test_queries", "by_phone_number", "%2B358123456789")

GET /test_users/_design/test_queries/_view/by_phone_number?key="%2B358123456789"&stale=update_after 200

Accept maps in writing API

I noticed that it's only possible to pass json strings to the writer.

I also see that the json is parsed into a map for some sanitation.

I think it makes sense to allow maps to be passed into the create method to save back and forth parsing.

Add Map-based API

implement wrappers to take / return Maps instead of JSON strings only

Integer key in view

When I use a view with an integer key, the function document_by_key doesn't work.

{:ok, body} = document_by_key(@db_props, %{design: "user", view: "by_s_id", key: Integer.to_string(s_id)}, :ok)

resulted in an empty list.

The url created by unauthenticated_document_by_key is like this
http://localhost:5984/db_dev/_design/user/_view/by_s_id?key=\"18155059\"&stale=ok

In the terminal I played with some queries.
curl -X GET http://localhost:5984/db_dev/_design/user/_view/by_s_id?key=\"18155059\"&stale=ok

Don't work. Result rows = empty list

curl -X GET http://localhost:5984/db_dev/_design/user/_view/by_s_id?key="18155059"&stale=ok
curl -X GET http://localhost:5984/db_dev/_design/user/_view/by_s_id?key=18155059&stale=ok

Both work. rows = One result.

I started this month with Elixir and I don't know if I do something wrong.

I have written a function document_by_int_key. This create in query_int_path
key=18155059 and not key=\"18155059\" for the url

Deprecation Strategy

After #38 there is a lot of deprecated code.

I personally would like to remove all deprecated functions. I don't know what the general opinion is.

I understand the backwards compatibility will break, but ultimately it will make the code a lot cleaner.

Limit and Skip?

Hi, I'm trying to use the query parameters skip and limit to paginate an output, did you implement them in any way?

Example:

http://localhost:5984/db/_design/d/_view/random?skip=i&limit=1

Add Basic Auth for database creation

I noticed there is no way to create a database with basic authentication.

This is necessary when you can't access you database on localhost (docker is a typical example).

Would you merge a PR if I provided one?

Connection closed errors

Happens rarely on local developer workstation. Quite often on Travis CI VMs.

  1. test destroy/3: attempting to delete a document with wrong revision triggers an error (Couchdb.Connector.WriterTest)
    test/couchdb_connector/writer_test.exs:94
    ** (HTTPoison.Error) :closed
    stacktrace:
    (httpoison) lib/httpoison.ex:66: HTTPoison.request!/5
    (couchdb_connector) lib/couchdb_connector/writer.ex:99: Couchdb.Connector.Writer.do_create/2
    test/couchdb_connector/writer_test.exs:95

Implement basic attachment handling

OAuth and Cookie Authentication

Hey Markus!

I was looking for a way to use couchdb with phoenix to create a clustered (phoenix) and db synced (couchdb) API backend.

However doing rest calls with basic auth every time is not secure.

Is there a chance you would have time to look into cookie + oauth2 auth for this?

What do you think is the effort?
Anything I can do to help?
Where could I start looking in your code to expand on this?

Thank you!

Couchdb.Connector.Writer.create/2 undefined

Hi there,

it seems that I can't do Couchdb.Connector.Writer.create(db_props, "{"key": "value"}") as Couchdb.Connector.Writer.create/2 is undefined. Only Couchdb.Connector.Writer.create/3 is available. What if I don't want to pass an id?

Thanks for your reply,
Didier

tests occasionally fail with 'reason: :closed'

stacktrace of a failed test

  1. test create/3: ensure that wrong database properties results in an error on write (Couchdb.Connector.WriterTest)
    test/couchdb_connector/writer_test.exs:20
    ** (MatchError) no match of right hand side value: {:error, %HTTPoison.Error{id: nil, reason: :closed}}
    stacktrace:
    test/test_prep.exs:11: Couchdb.Connector.TestPrep.delete_database/0
    (ex_unit) lib/ex_unit/on_exit_handler.ex:82: ExUnit.OnExitHandler.exec_callback/1
    (ex_unit) lib/ex_unit/on_exit_handler.ex:66: ExUnit.OnExitHandler.on_exit_runner_loop/0

Handle attachments.

I have code ready for the dev branch (soon) that handles attachments. I am meticulously going through tests and fixing bugs.

Dependency error

When running 'mix deps.get' I get this error:

Running dependency resolution
Conflict on poison 2.1.0
mix.lock: 2.1.0
couchdb_connector 0.2.0: ~> 1.5.0
phoenix 1.1.4: ~> 1.5 or ~> 2.0

** (Mix) Hex dependency resolution failed, relax the version requirements or unlock dependencies

How do I solve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.