Giter VIP home page Giter VIP logo

php-couchdb's People

Contributors

akissa avatar andykimpe avatar shrink0r avatar thomasbachem 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

Watchers

 avatar  avatar  avatar

php-couchdb's Issues

Feature request: Support query method

Good day!
Can you add support for query method for raw request? For example,
$query = '/test_db/design/test/_info';
$method = 'POST'; // by default GET
$conn->query($query, $method);

Thank you!

Feature request: Support arguments in .getView() method

Can you add support for arguments in .getView() method? For example, this syntax will be very useful for developers.

$args = array( 'startkey' => $startKey, 'endkey' => $endKey, 'limit' => $limit, ); $response = $client->getView('foo', 'map', $args);

http://wiki.apache.org/couchdb/HTTP_view_API?highlight=((Introduction_to_CouchDB_views))#Querying_Options
I guess that no need to validate arguments, just build argument string as is.

Thank you!

not make on freebsd

/arch/dist/php-couchdb/couchdb.c:35:23: error: curl/curl.h: No such file or directory
/arch/dist/php-couchdb/couchdb.c:343: error: expected '=', ',', ';', 'asm' or 'attribute' before 'couchdb_make_request'
/arch/dist/php-couchdb/couchdb.c: In function 'couchdb_prepare_request':
/arch/dist/php-couchdb/couchdb.c:507: warning: implicit declaration of function 'couchdb_make_request'
/arch/dist/php-couchdb/couchdb.c: In function 'zim_CouchdbClient_storeDoc':
/arch/dist/php-couchdb/couchdb.c:1138: warning: dereferencing type-punned pointer will break strict-aliasing rules
/arch/dist/php-couchdb/couchdb.c:1143: warning: dereferencing type-punned pointer will break strict-aliasing rules
/arch/dist/php-couchdb/couchdb.c:1161: warning: dereferencing type-punned pointer will break strict-aliasing rules
/arch/dist/php-couchdb/couchdb.c: In function 'zm_startup_couchdb':
/arch/dist/php-couchdb/couchdb.c:2423: warning: implicit declaration of function 'curl_global_init'
/arch/dist/php-couchdb/couchdb.c:2423: error: 'CURL_GLOBAL_DEFAULT' undeclared (first use in this function)
/arch/dist/php-couchdb/couchdb.c:2423: error: (Each undeclared identifier is reported only once
/arch/dist/php-couchdb/couchdb.c:2423: error: for each function it appears in.)
/arch/dist/php-couchdb/couchdb.c:2423: error: 'CURLE_OK' undeclared (first use in this function)
/arch/dist/php-couchdb/couchdb.c: In function 'zm_shutdown_couchdb':
/arch/dist/php-couchdb/couchdb.c:2449: warning: implicit declaration of function 'curl_global_cleanup'
*** Error code 1

Upsert method

Would love to see a utility method for handling upsert pattern and automated conflict resolution.
Feature should allow for 'partial update' of document. I know it's not part of the Couch API, but I think it's something that everyone finds to be an irritation and handling in the library would make life easier.

Upsert outline:
if duplicate key on insert, pull existing document with conflicting key, merge new document into existing document replacing existing values, save merged document and return with new _rev.

Auto conflict resolution:
if when saving, newer version exists (conflict), pull newer version of document, merge data from request into new document, save merged document and return new _rev

Partial update description:
given existing document in couchdb
{
"_id": "doc1",
"_rev": "AAA",
"type": "mytype",
"value": "ZZZ"
}

now we have the _id of that doc from a result set from a view, and just want to append a new property/attribute to the doc without having to jump through exception handling hoops in client code every time,

$update_doc = array("_id"=>"doc1","mynewfield"=>"mynewvalue");
$res = $conn->upsertDoc($update_doc);

we end up with
$res == array("ok"=>1, "id" => "doc1", "rev"=>"BBB");

and in couchdb:

{
  "_id": "doc1",
  "_rev": "BBB",
  "type": "mytype",
  "value": "ZZZ",
  "mynewfield": "mynewvalue"
}

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.