Comments (6)
We will make our own driver by cherry picking relevant codes in other libraries.
from cozy-stack.
Can you list what are the choice criteria (may be "functional" ones) ? (connection pool, binary, auto-marshalling, https...)
What is mandatory, what is nice-to-have ?
from cozy-stack.
Hi @tomsquest, Thanks for your feedback !
I added a section on how we will use it, which covers the functional needs.
This allowed to identify the first library as the only one providing access to the internal Client/Transport and allowing fine-tuning. I am not yet sure how much we will need to tweak the golang defaults pooling strategy, but sure would be helpful if we can do it !
from cozy-stack.
Edit: deduce database instead of setting it manually with database(...)
Another advantage of a DIY solution: building exactly what stack
needs.
This is orienting the CouchDB access code for Cozy usage.
And this could be implemented as a DSL.
For example:
(if I understand the architecture, the goal is for an User to have many Databases, one for each DocumentType)
// Create an Email
couchdb
.Doc(anEmail) // deduce the database from the type of the parameters
.Create()
// .Update()
// .Delete()
// List emails from 100 to 200
emails = couchdb
.emails() // pick the appropriate database
.Offset(100)
.Limit(200)
.Order(DATE, DESC)
.select() // Create the adhoc CouchDb query (`Mango` style ?)
BTW, couchdb
could be an already configured object with the appropriate user credentials.
Pros:
- Cozy-stack oriented (functionally)
- Still able to access CouchDb natively (eg.
couchdb.Connection()
) - Can hide technical stuff: access to the pool, concurrency, caching, https, retries, timeouts...
- Build and maintained by Cozy
Cons:
- DSL to write (and testing is a bit harder)
- To be maintained, but in fact, this is already the case for the other wrappers
from cozy-stack.
This discussion has been moved to docs (34b699d). It can be continued on a PR of this docs/couchdb-plugins.md
if the need arise (new great couchdb2 package ?).
Thanks again @tomsquest for your input.
from cozy-stack.
@aenario you're welcome.
from cozy-stack.
Related Issues (20)
- exitAfterDefer issue
- nsjail Versus wasm HOT 3
- Discussion: `/public/avatar` and `/:sharing-id/recipients/:index/avatar` HOT 3
- Different behaviour between `POST /sharings` and `POST /sharings/` HOT 2
- Inconsistent error title HOT 2
- CI feature: integrate pull request preview environments
- Issues some implementations issues in `lock` package HOT 5
- Moving back from https://github.com/cozy/afero to https://github.com/spf13/afero? HOT 12
- Discussion: Code coverage integration? HOT 2
- Can't run integration tests HOT 2
- can't make cozy working behind cloudflared HOT 1
- New route GET /settings/bitwarden for consistency
- Docker doesn't work HOT 2
- Can't install cozy stack HOT 2
- FAIL TO SETUP Error: badly formated URL
- Read-only file system error from cozy-stack HOT 3
- feature request: default `couchdb.url` to environment variable in default cozy config HOT 4
- Docker feature request: moving user/group creation and ownership change to Dockerfile HOT 5
- Import local fs files / Fix desynchronization HOT 2
- Using apache as reverse proxy + CORS policy HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cozy-stack.