baachi / couchdb Goto Github PK
View Code? Open in Web Editor NEWCouchDB Client for PHP >=5.5
License: MIT License
CouchDB Client for PHP >=5.5
License: MIT License
Currently you can access the couchdb database with magic methods, because it should work like the mongodb repo.
But I don't like the magic methods because you don't have control about whats going on and it makes debugging more harder.
So i think this methods should be removed.
How about a QueryBuilder
that could enable stuff like this?
$result = $this->database->query()
->design('users')
->view('user-by-username')
->key($username)
->includeDocs(true)
->execute();
I already have something to start from :)
Guzzle does offer using Promise structures for their responses.
How about using these to offer parallel requests to CouchDB?
Optimize the HTTP Socket Client.
Create a logging client for better debugging.
I added some more helpers to the Result
class, like this:
public function getFirstDoc()
{
$row = $this->getFirstRow();
return $row ? $row['doc'] : false;
}
public function getDocs()
{
return array_map(function($row) {
return $row['doc'];
}, $this->getRows());
}
public function isEmpty()
{
return !(bool)$this->data['rows'];
}
public function isError()
{
return array_key_exists('error', $this->data);
}
public function isNotFound()
{
return $this->isError() && ($this->data['error'] == 'not_found');
}
Maybe these could be usefull in your Result class.
There is a Guzzle middleware for caching via ETag and such. That could be integrated and offered by this client:
How about changing the Namespace from CouchDB\
to something, that will most likely not collide with other software?
Add a filesystem like GridFS from MongoDB
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.