You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

Project page for Chillax: http://github.com/sykopomp/chillax

Introduction

Chillax is a CouchDB abstraction layer for Common Lisp.

Chillax also includes a CouchDB view server, which can be used to write CouchDB views in full, native Common Lisp.

Chillax includes several systems:

Features

Quickstart example

Chillax is Quicklisp-installable, allowing for super-quick, painless installation of Chillax and all its dependencies.

Make sure CouchDB is installed, and currently running. This example assumes that the server is running in localhost, using the default 5984 port. Yason's alist encoder/decoder is used below to make replies readable (by default, it uses hash tables as JSON objects, instead of alists).

CL-USER> (ql:quickload 'chillax)
CL-USER> (in-package :chillax)
CHILLAX> (defparameter *server* (make-instance 'yason-server :object-as-alist-p t
                                               :parse-object-key-fun
                                               (lambda (string) (intern string *package*))))
*SERVER*
CHILLAX> (defparameter *db* (ensure-db *server* "test"))
*DB*
CHILLAX> (all-documents *db*)
((|rows|) (|offset| . 0) (|total_rows| . 0))
CHILLAX> (put-document *db* "my_test_doc" '((name . "Josh") (favorite-language . "common-lisp")))
((|rev| . "1-3c964cc898c03c48903a91d90b24a269")
 (|id| . "my_test_doc") (|ok| . T))
CHILLAX> (get-document *db* "my_test_doc")
((FAVORITE-LANGUAGE . "common-lisp")
 (NAME . "Josh")
 (|_rev| . "1-3c964cc898c03c48903a91d90b24a269")
 (|_id| . "my_test_doc"))
CHILLAX> (delete-document *db* (cdr (assoc '|_id| *)) (cdr (assoc '|_rev| *)))
((|rev| . "2-2221fc2b97c1fac1a82ba07d2835ac80")
 (|id| . "my_test_doc")
 (|ok| . T))

By implementing a couple of generic functions, you can hook your own JSON encoding/decoding mechanism into Chillax -- including encoding and decoding instances of your own classes. The protocol for doing so is very straightforward and well-documented.

Using it

Chillax is licensed under the MIT license. For API documentation and more details, please visit the project page.

Chillax (last edited 2011-11-23 14:45:33 by JanLehnardt)