CouchDB Library
Posted: Mon Jul 27, 2015 9:48 pm
I have been working on a library for Apache CouchDB which I'm going to say is about 50% done.
Looking for users who are familiar with CouchDB who'd like to help test.
Also, this is really my first time sharing code with anyone other than people I work with, so any comments critiques or criticisms would be helpful for future projects I want to share. You can message me here, or email me at pink@mad.pink
The code is on Github here:
https://github.com/madpink/couchdb4live ... /daybed.lc
I'm calling this version: 0.0.23 July 27, 2015
This is a simple library that calls CouchDB's REST functions and then decodes them using EasyJSON.
EasyJSON is included in the code.
There are 4 main groups of functions:
Server Commands (50% implemented)
Document Commands (80% implemented)
Database Commands (60% implemented)
Design Document Commands (0%)
Long term to do plans:
A 5th group of functions is being worked on for creating a local store.
A stack called Daybed is in the works which will hopefully be a full Livecode replacement for Futon.
I've tested using versions 1.5.0. 1.6.0 and 1.6.1, nothing earlier has been tested.
I've tested with the following hosts: IrisCouch & SmileUpps
This library has not been tested on Cloudant or the beta of 2.0.0
Documentation is incomplete
Most of these functions take one or more these parameters:
pURL - the URL of the CouchDB installation, including "http://", the port numer and a trailing slash
For example: "http://192.168.23.42:5984/"
With username/password: "http://admin:trustno1@192.168.23.42:5984/"
pDB - the name of the database being accessed
pParams - an array with any OPTIONAL parameters, with the parameter as a key.
For example: to download documents when running the _all_docs function, and limit the list to only 10 records:
put true into tOptions["include_docs"]
put 10 into tOptions["limit"]
(then pass tOptions in the function)
pDocID - (used in GET functions) the "_id" value of the document you are downloading
pDoc - (used in PUT functions) an array with the data to be converted to JSON and uploaded to CouchDB.
When a specific revision number is required by CouchDB, two approaches can be used:
1. add it to the array being used for pParams, for example: put "2-95a8c0a9268e896dd9c46a1b2a6e9c80" into tOptions["rev"]
2. include it in the pDoc array (with an underscore): put "2-95a8c0a9268e896dd9c46a1b2a6e9c80" into tDocument["_rev"]
Looking for users who are familiar with CouchDB who'd like to help test.
Also, this is really my first time sharing code with anyone other than people I work with, so any comments critiques or criticisms would be helpful for future projects I want to share. You can message me here, or email me at pink@mad.pink
The code is on Github here:
https://github.com/madpink/couchdb4live ... /daybed.lc
I'm calling this version: 0.0.23 July 27, 2015
This is a simple library that calls CouchDB's REST functions and then decodes them using EasyJSON.
EasyJSON is included in the code.
There are 4 main groups of functions:
Server Commands (50% implemented)
Document Commands (80% implemented)
Database Commands (60% implemented)
Design Document Commands (0%)
Long term to do plans:
A 5th group of functions is being worked on for creating a local store.
A stack called Daybed is in the works which will hopefully be a full Livecode replacement for Futon.
I've tested using versions 1.5.0. 1.6.0 and 1.6.1, nothing earlier has been tested.
I've tested with the following hosts: IrisCouch & SmileUpps
This library has not been tested on Cloudant or the beta of 2.0.0
Documentation is incomplete
Most of these functions take one or more these parameters:
pURL - the URL of the CouchDB installation, including "http://", the port numer and a trailing slash
For example: "http://192.168.23.42:5984/"
With username/password: "http://admin:trustno1@192.168.23.42:5984/"
pDB - the name of the database being accessed
pParams - an array with any OPTIONAL parameters, with the parameter as a key.
For example: to download documents when running the _all_docs function, and limit the list to only 10 records:
put true into tOptions["include_docs"]
put 10 into tOptions["limit"]
(then pass tOptions in the function)
pDocID - (used in GET functions) the "_id" value of the document you are downloading
pDoc - (used in PUT functions) an array with the data to be converted to JSON and uploaded to CouchDB.
When a specific revision number is required by CouchDB, two approaches can be used:
1. add it to the array being used for pParams, for example: put "2-95a8c0a9268e896dd9c46a1b2a6e9c80" into tOptions["rev"]
2. include it in the pDoc array (with an underscore): put "2-95a8c0a9268e896dd9c46a1b2a6e9c80" into tDocument["_rev"]