https://github.com/manuels/async-couchdb-api
Asynchronous Javascript API for CouchDB
https://github.com/manuels/async-couchdb-api
Last synced: 7 months ago
JSON representation
Asynchronous Javascript API for CouchDB
- Host: GitHub
- URL: https://github.com/manuels/async-couchdb-api
- Owner: manuels
- Created: 2010-06-18T16:59:20.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2010-06-18T18:54:47.000Z (almost 16 years ago)
- Last Synced: 2025-03-24T14:17:08.391Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
This is a modified version of the javascript file you usually get when you call http://localhost:5984/_utils/script/couch.js but this version works asynchronously!
The modification looks like this:
- You can specify a default error callback function at {this,CouchDB}.errorCallback
- The first argument of any function is usually the callback function that is executed when the command succeeded
Then the ordinary arguments follow
The last (optional) argument is the error callback function
You can specify a base url at {this,CouchDB}.server. Usually this is not supported when you use a browser, but it works (and is needed) for QML.
Example:
If your synchronous call looked like this:
console.log( CouchDB.getVersion() );
it looks like this in the asynchronous version:
CouchDB.getVersion(console.log);