https://github.com/manuels/async-couchdb-api
Asynchronous Javascript API for CouchDB
https://github.com/manuels/async-couchdb-api
Last synced: 3 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 (about 15 years ago)
- Default Branch: master
- Last Pushed: 2010-06-18T18:54:47.000Z (about 15 years ago)
- Last Synced: 2025-01-29T19:12:34.760Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 97.7 KB
- Stars: 2
- Watchers: 3
- 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 functionYou 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);