Warning: Creating default object from empty value in /var/www/www.eerraa.com/public/wp-content/themes/minamaze/admin/main/inc/class.redux_filesystem.php on line 29
lcCouchQueryBuilder – eerraa.com



Shortcode Error: GitHub repository not found

What can I do with it?

This is a LiveCode library that can be used to build CouchDB queries with less coding effort spent.

Supported Features

  • connect to couchdb
  • Query _all_docs
  • Query custom _views
  • Create, get, update, delete documents
  • Add, get, delete attachments


  • Community: GPL

Tested with

  • LiveCode 7


Method Reference

See reference

Loading the libraries

In your stack file in the “on openStack” message add following lines of code:

on openStack
   local tStackfiles
   put "lcLibJson,lib/lcLibJson.livecode" & cr into tStackfiles
   put "lcCouchQueryBuilder,lib/lcCouchQueryBuilder.livecode" after tStackFiles
   set the stackfiles of this stack to tStackfiles
   start using stack "lcLibJson"
   start using stack "lcCouchQueryBuilder"
end openStack

This will load both libraries in to your stack file when you open the stack.


on mouseUp
   local tCouchConfig, tResult, tDoc, tUpdateDoc
   put empty into tCouchConfig
   put "" into tCouchConfig["url"]
   put couchInit(tCouchConfig["url"]) into tResult
   put empty into tDoc
   put "James" into tDoc["firstname"]
   put "Jameson" into tDoc["lastname"]
   put "Blastreet 557" into tDoc["street"]
   put "889966" into tDoc["zipcode"]
   put "Far away" into tDoc["city"]
   -- create
   put couchCreateDocument(tDoc) into tResult
   -- get
   put couchGetDocument(tResult["id"]) into tResult
   -- update
   put tResult into tUpdateDoc
   put "Other planet" into tUpdateDoc["country"]
   put couchUpdateDocument(tUpdateDoc["_id"], tUpdateDoc["_rev"], tUpdateDoc) into tResult
   -- delete
   put couchDeleteDocument(tResult["id"], tResult["rev"]) into tResult
   -- query view
   put couchQueryView("testdb", "testview") into tResult
   -- query all docs
   put couchQueryAllDocs() into tResult
end mouseUp

Leave A Reply