This is the clouchdb Reference Manual, version 0.0.12, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:47:32 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
clouchdb
0.0.12
closer-mop
(system).
drakma
(system).
parenscript
(system).
s-base64
(system).
flexi-streams
(system).
package.lisp
(file).
clouchdb.lisp
(file).
decoder.lisp
(file).
encoder.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
clouchdb/clouchdb.asd
clouchdb/package.lisp
clouchdb/clouchdb.lisp
clouchdb/decoder.lisp
clouchdb/encoder.lisp
clouchdb/clouchdb.asd
clouchdb
(system).
*clouchdb-version*
(special variable).
clouchdb/clouchdb.lisp
package.lisp
(file).
clouchdb
(system).
*couchdb*
(special variable).
ad-hoc-view
(function).
add-attachment
(function).
all-docs-by-seq
(function).
as-deleted-document
(function).
as-field-name-string
(function).
as-keyword-symbol
(function).
attachment-list
(function).
attachment-missing
(condition).
attachment-name
(function).
bulk-document-update
(function).
changes
(function).
compact-db
(function).
copy-document
(function).
couchdb-document-properties
(function).
create-db
(function).
create-document
(function).
create-ps-view
(function).
create-temp-db
(function).
create-temp-db-name
(function).
create-view
(function).
db-already-exists
(condition).
db-document-fetch-fn
(reader).
(setf db-document-fetch-fn)
(writer).
db-document-update-fn
(reader).
(setf db-document-update-fn)
(writer).
db-does-not-exist
(condition).
db-existential-error
(condition).
db-host
(reader).
(setf db-host)
(writer).
db-name
(reader).
(setf db-name)
(writer).
db-password
(reader).
(setf db-password)
(writer).
db-port
(reader).
(setf db-port)
(writer).
db-protocol
(reader).
(setf db-protocol)
(writer).
db-user
(reader).
(setf db-user)
(writer).
delete-attachment
(function).
delete-db
(function).
delete-document
(function).
delete-view
(function).
doc-error
(condition).
document-as-hash
(function).
document-id
(function).
document-missing
(condition).
document-properties
(function).
document-property
(function).
(setf document-property)
(function).
document-revision
(function).
get-active-tasks
(function).
get-all-documents
(function).
get-attachment-stream
(function).
get-config
(function).
get-couchdb-info
(function).
get-db-info
(function).
get-document
(function).
get-uuids
(function).
id-missing
(condition).
id-or-revision-conflict
(condition).
illegal-database-name
(condition).
invoke-view
(function).
list-dbs
(function).
make-db
(function).
post-document
(function).
ps-view
(macro).
put-document
(function).
query-document
(function).
replicate
(function).
save-attachment
(function).
set-connection
(function).
set-document-property
(function).
with-attachment
(macro).
with-connection
(macro).
with-temp-db
(macro).
*changes-options*
(special variable).
*debug-requests*
(special variable).
*default-content-type*
(special variable).
*default-db-name*
(special variable).
*default-host*
(special variable).
*default-port*
(special variable).
*default-protocol*
(special variable).
*temp-db-counter*
(special variable).
*text-types*
(special variable).
*view-function-names*
(special variable).
*view-options*
(special variable).
+utf-8+
(constant).
add-admin
(function).
add-functions
(function).
add-lists-fns
(function).
add-shows-fns
(function).
att-name
(reader method).
attachments
(reader method).
authorization-error
(condition).
cat
(macro).
clouchdb-error
(condition).
compact-view
(function).
convert-encoding
(function).
copy-db
(function).
couchdb-database-url
(function).
couchdb-host-url
(function).
db
(reader method).
db
(reader method).
db
(structure).
db-or-db-name
(macro).
db-p
(function).
db-request
(function).
define-constant
(macro).
defpsfun
(macro).
description
(reader method).
doc-as-alist
(function).
document-update-notify
(function).
doublequote
(function).
encode-attachments
(function).
encode-file
(function).
ensure-db
(macro).
ensure-design-doc
(function).
false-if-false
(function).
get-session
(function).
get-stats
(function).
id
(reader method).
id-value
(reader method).
input
(reader method).
invalid-design-doc
(condition).
invalid-document
(condition).
invalid-id
(condition).
invalid-type
(condition).
invoke-list
(function).
json-stream-or-string-to-document
(function).
keyword-to-http-param
(function).
logout-session
(function).
make-db-auth
(function).
make-db-identifier
(function).
make-default-db
(function).
make-uri
(function).
new-db
(function).
ps-function
(macro).
ps-view-def
(reader method).
ps-view-def-error
(condition).
reason
(reader method).
result
(reader method).
result
(reader method).
set-session
(function).
string-join
(function).
text
(reader method).
text
(reader method).
transform-param
(function).
transform-params
(function).
true-if-true
(function).
uri
(reader method).
uri
(reader method).
url-encode
(macro).
validate-ps-view
(function).
value
(reader method).
value-as-integer
(function).
value-as-string
(function).
view-cleanup
(function).
view-util
(function).
clouchdb/decoder.lisp
clouchdb.lisp
(file).
clouchdb
(system).
json-to-document
(function).
*digits*
(special variable).
*json-make-big-number*
(special variable).
*json-number-valid-chars*
(special variable).
*json-object-factory*
(special variable).
*json-object-factory-add-key-value*
(special variable).
*json-object-factory-return*
(special variable).
*json-rules*
(special variable).
*json-symbols-package*
(special variable).
*use-strict-json-rules*
(special variable).
add-json-dispatch-rule
(function).
decode-json
(function).
decode-json-strict
(function).
json-escaped-char-to-lisp
(function).
json-intern
(function).
json-parse-error
(condition).
read-chars-until
(function).
read-constant
(function).
read-json-array
(function).
read-json-chars
(function).
read-json-number
(function).
read-json-object
(function).
read-json-string
(function).
read-n-chars
(function).
clouchdb/encoder.lisp
decoder.lisp
(file).
clouchdb
(system).
document-to-json
(function).
*json-lisp-escaped-chars*
(special variable).
assoclp
(function).
document-to-json-stream
(function).
encode
(function).
keyword-assocp
(function).
lisp-special-char-to-json
(function).
write-alist
(function).
write-json-chars
(function).
write-json-number
(function).
write-json-string
(function).
write-json-symbol
(function).
write-list
(function).
Packages are listed by definition order.
clouchdb
common-lisp
.
parenscript
.
*couchdb*
(special variable).
ad-hoc-view
(function).
add-attachment
(function).
all-docs-by-seq
(function).
as-deleted-document
(function).
as-field-name-string
(function).
as-keyword-symbol
(function).
attachment-list
(function).
attachment-missing
(condition).
attachment-name
(function).
bulk-document-update
(function).
changes
(function).
compact-db
(function).
copy-document
(function).
couchdb-document-properties
(function).
create-db
(function).
create-document
(function).
create-ps-view
(function).
create-temp-db
(function).
create-temp-db-name
(function).
create-view
(function).
db-already-exists
(condition).
db-document-fetch-fn
(reader).
(setf db-document-fetch-fn)
(writer).
db-document-update-fn
(reader).
(setf db-document-update-fn)
(writer).
db-does-not-exist
(condition).
db-existential-error
(condition).
db-host
(reader).
(setf db-host)
(writer).
db-name
(reader).
(setf db-name)
(writer).
db-password
(reader).
(setf db-password)
(writer).
db-port
(reader).
(setf db-port)
(writer).
db-protocol
(reader).
(setf db-protocol)
(writer).
db-user
(reader).
(setf db-user)
(writer).
delete-attachment
(function).
delete-db
(function).
delete-document
(function).
delete-view
(function).
doc-error
(condition).
document-as-hash
(function).
document-id
(function).
document-missing
(condition).
document-properties
(function).
document-property
(function).
(setf document-property)
(function).
document-revision
(function).
document-to-json
(function).
get-active-tasks
(function).
get-all-documents
(function).
get-attachment-stream
(function).
get-config
(function).
get-couchdb-info
(function).
get-db-info
(function).
get-document
(function).
get-uuids
(function).
id-missing
(condition).
id-or-revision-conflict
(condition).
illegal-database-name
(condition).
invoke-view
(function).
json-to-document
(function).
list-dbs
(function).
make-db
(function).
post-document
(function).
ps-view
(macro).
put-document
(function).
query-document
(function).
replicate
(function).
save-attachment
(function).
set-connection
(function).
set-document-property
(function).
with-attachment
(macro).
with-connection
(macro).
with-temp-db
(macro).
*changes-options*
(special variable).
*debug-requests*
(special variable).
*default-content-type*
(special variable).
*default-db-name*
(special variable).
*default-host*
(special variable).
*default-port*
(special variable).
*default-protocol*
(special variable).
*digits*
(special variable).
*json-lisp-escaped-chars*
(special variable).
*json-make-big-number*
(special variable).
*json-number-valid-chars*
(special variable).
*json-object-factory*
(special variable).
*json-object-factory-add-key-value*
(special variable).
*json-object-factory-return*
(special variable).
*json-rules*
(special variable).
*json-symbols-package*
(special variable).
*temp-db-counter*
(special variable).
*text-types*
(special variable).
*use-strict-json-rules*
(special variable).
*view-function-names*
(special variable).
*view-options*
(special variable).
+utf-8+
(constant).
add-admin
(function).
add-functions
(function).
add-json-dispatch-rule
(function).
add-lists-fns
(function).
add-shows-fns
(function).
assoclp
(function).
att-name
(generic reader).
attachments
(generic reader).
authorization-error
(condition).
cat
(macro).
clouchdb-error
(condition).
compact-view
(function).
convert-encoding
(function).
copy-db
(function).
couchdb-database-url
(function).
couchdb-host-url
(function).
db
(generic reader).
db
(structure).
db-or-db-name
(macro).
db-p
(function).
db-request
(function).
decode-json
(function).
decode-json-strict
(function).
define-constant
(macro).
defpsfun
(macro).
description
(generic reader).
doc-as-alist
(function).
document-to-json-stream
(function).
document-update-notify
(function).
doublequote
(function).
encode
(function).
encode-attachments
(function).
encode-file
(function).
ensure-db
(macro).
ensure-design-doc
(function).
false-if-false
(function).
get-session
(function).
get-stats
(function).
id
(generic reader).
id-value
(generic reader).
input
(generic reader).
invalid-design-doc
(condition).
invalid-document
(condition).
invalid-id
(condition).
invalid-type
(condition).
invoke-list
(function).
json-escaped-char-to-lisp
(function).
json-intern
(function).
json-parse-error
(condition).
json-stream-or-string-to-document
(function).
keyword-assocp
(function).
keyword-to-http-param
(function).
lisp-special-char-to-json
(function).
logout-session
(function).
make-db-auth
(function).
make-db-identifier
(function).
make-default-db
(function).
make-uri
(function).
new-db
(function).
ps-function
(macro).
ps-view-def
(generic reader).
ps-view-def-error
(condition).
read-chars-until
(function).
read-constant
(function).
read-json-array
(function).
read-json-chars
(function).
read-json-number
(function).
read-json-object
(function).
read-json-string
(function).
read-n-chars
(function).
reason
(generic reader).
result
(generic reader).
set-session
(function).
string-join
(function).
text
(generic reader).
transform-param
(function).
transform-params
(function).
true-if-true
(function).
uri
(generic reader).
url-encode
(macro).
validate-ps-view
(function).
value
(generic reader).
value-as-integer
(function).
value-as-string
(function).
view-cleanup
(function).
view-util
(function).
write-alist
(function).
write-json-chars
(function).
write-json-number
(function).
write-json-string
(function).
write-json-symbol
(function).
write-list
(function).
clouchdb-asd
asdf/interface
.
common-lisp
.
*clouchdb-version*
(special variable).
Definitions are sorted by export status, category, package, and then by lexicographic order.
The current version of clouchdb
A db struct object
Create a view using parenscript
Passed doc-or-id and attachment parameters to get-attachment-stream to open the input stream and ensures that the stream is automatically closed after execution of the statements in the body.
Execute body in the context of the specified database connection information..
Execute body in context of newly created, temporary database. Delete database before return.
Execute query using an ad-hoc view.
Attach content to a document identified by either the id or doc parameter. If the document does not already exist it will be created.
Fetch a list of all documents that were updated and deleted, in the order these actions are done.
Return specified document in a format used by bulk-document-update to indicate that the document should be deleted in the bulk operation.
Convert a case-encoded symbol to a potentially mixed case string.
Return value in a form that would be used to identify the car of a value in a document. For example, a value
List attachments associated with document. If the document id is specified in the first parameter then this function will fetch the corresponding document from the server in order to get the attachment list, otherwise it will simply return the list of attachments in the specified document unless keyword parameter fetch is true.
Return the name of an attachment, possibly converting from the keyword symbol of the clouchdb document to a string e.g. :|text.txt| to ’text.txt’, or the car of a single document attachment list element e.g, ’(:|text.txt| (:|stub| . T) (..)) to ’text.txt’.
Update multiple documents in a single request. The <b>docs</b> parameter is a list of documents. Any document in the list that does not contain an :|_id| value is created with a CouchDb assigned ID. Documents that contain a ’(:|_deleted| . t) top-level property will be deleted. Documents that contain an :|_id| property will be updated. If all-or-nothing is true then all operations must succeed for any to succeed, default is false.
Get document change activity from current database or database
specified in db parameter. The :feed keyword parameter value indicates
how to poll for changes. Valid values for this parameter
include :longpoll to block waiting for a single change
response, :continuous to poll for changes indefinately, or :normal to
not poll (the default) and instead return a document containing
changes. If specified, the :style keyword parameter may be either
:main-only (the default) or :all-docs for more revision information.
If specified, the notify-fn will be called as each change notification is recieved from the server. The notify-fn should return nil to signal that it no longer wishes to receive change notificaitons. At that point the stream will be closed and the changes function will return.
If :longpoll or :continuous is specified as the feed parameter but no notify-fn is provided, this function will return the feed stream. It is the caller’s responsibility to close the stream.
Start compaction on current database, or specified database if supplied. The db parameter, if supplied, is either a local database name string or a db struct.
Copy source document to destination. The source parameter may be
either a document ID or a document from which the ID will be
obtained. The destination parameter may also be a document ID or
document. If the destination document does not already exist it will
be created.
If the destination document does exist and the intention is to
overwrite that document, then the destination document revision must
be specified. If the destination parameter is a document then the
revision information will be taken from that document unless
the :revision parameter is specified. The revision parameter must be
the current revision of the destination document. Alternatively the
revision parameter may be the keyword
:current which will cause this function to fetch the current
revision number from the database.
Return only CouchDb specific document properties (opposite of document-properties).
Create database. The db parameter may be either a string which is the name of the database to create or an instance of a db structure. If db is unspecified, uses *couchdb*. If database already exists an error condition is raised. This condition can be avoided by specifying :ingore for if-exists. In this case no error condition is generated. Specify :recreate to potentially delete and create a new database.
Create a new document, optionally specifying the new document ID.
Create one or more views in the specified view document ID.
Create a temporary database.
Return a database name that’s probably unique.
Create one or more views in the specified view document ID.
Delete (detach) an attachment. The attachment parameter is either the name of the file to remove from the document, which can be either a string or a keyword symbol (as obtained from the :|_attachments| value of a document) or it’s one element of the list of attachments in a document.
Delete database. If db and db-name are unspecified, deletes
database named in *couchdb*. Normally deletion of non-existent databases
generates an error condition, but this can be avoided by
specifying :ignore in the if-missing parameter.
Delete a document. The doc-or-id parameter may be either the document ID or the document itself. If the doc-or-id value is the document ID and no revision parameter is specified, then the document is fetched from the server to get the current revision, since the revision is necessary to complete the operation. If the doc-or-id value is a document then the revision value in the document is used unless a different revision is specified. At most one revision of the document will be deleted.
Delete identified view document
Convert a document to a hashtable if it isn’t one already. Document should be in the form of an associative list.
Shortcut for getting the ID from the specified document. First checks for :|_id| property, then :|id|
Return the document properties, filtering out any couchdb reserved properties (properties that start with an underscore).
Get the value associated with the document property or nil if there is no associated value. Note that name may be either a keyword symbol, a regular symbol or a string. The <b>name</b> parameter may be either a single keyword identifier (document property identifier) or it may be a list of identifiers.
Allows setting of existing document properties in
place (destructively). The name paramter may be either a single
keyword identifier (document property identifier) or it may be a list
of identifiers. If the specified document property does not already
exist it is created.
Return the revision number for the document, identified by either the document ID, the actual document, or the result of an add or update that returns the revision as :|rev|
Encode document to string with special support for detecting and handling associative lists.
Get active tasks for database or nil.
Get a listing of all documents in a database. This method implements the same keyword parameters as the view API.
Get specified attachment as a stream. The caller is responsible for closing the stream. Return stream and HTTP status
Get database configuration.
Get information from the couchdb server.
Get information for named database, return ((:|error|
. "not_found") (:|reason| . "no_db_file")) if database does not
exist. The db parameter, if supplied, is either a local database
name string or a db struct.
Get a document by ID. Returns nil if the document does not exist. The revision property specifies an optional revision number, if unspecified, the most recent revision is returned. The revisions and revision-info parameters, if non-nil, request revision information about the document instead of the actual document contents. The revision-info option contains more revision information than revisions. All revision* options are mutually exclusive, specify only one.
Returns one or more new UUID from the current database.
Invoke a view by specifiying the document ID that contains the view and the name of the contained view. The key parameter specifies an optional value to match against the view’s mapped field. The start-key and end-key values specify the optional begin and end range of the mapped field(s) of each document to return. If descending is t, returns results in reverse order. If update is t, does not refresh view for query, use for higher performance but possible data inconsistency.
Return a list of all databases managed by the current CouchDb host.
Create, populate and return a database structure from the current special variables and any supplied keyword parameters, the latter take precedence over the special variables.
Post the document to the server, creating a new document. An existing _id in the document will be ignored, the server will create a new document and assign a new ID. Therefore this is an easy method for copying documents. The return value includes the document ID in the :ID property.
Create a new document or update and existing one. If the document is new an ID must be specified (but see post-document). If the document has been fetched from the server (and still has its :_id property) then no ID need be specified. If an ID is specified and it differs from the existing :_id value, then a new document is created with the new ID and the non-special properties of the specified document, since the latter would generate a CouchDb error.
Return a list of all values in the document matching the query. For
example, given the document:
((:values (((:a . 1) (:b . 2)) ((:a . 3) (:b . 4)))))
the query string ’(:values :a) will return (3 1), i.e. the value of
both :a associations.
One special query input value is :* which is a ’wildcard’. With the
document described above the query ’(:values :*) will return (4 3 2
1), or the values of all associations directly below :values. The
query ’(:* :*) on this document will also return (4 3 2 1).
Another special query input value is :**, which recursively matches
the next query input. For example, with the following document:
((:level1 . ((:level2 . (((:level3 . 1)))))))
The query ’(:** :level3) will return (1), the value
of :level3. Finally, functions can specified in the query. Functions
are called with the portion of the document matched to the previous
query element and can either return the document, return a different
document or null.
Replicate current database to target, or source to target if source is specified. Source and target database values must either be strings or database structures. Use strings to specify simple local database names, use database structures to specify either local or remote databases. If true, create-target will cause the replication target to be created automatically, as of CouchDb version 0.11.
Save specified attachement from specified document to path on file
system. The doc-or-id parameter must either be a document ID string or
the actual document. The attachment parameter is either the string
value of the attachment name, e.g. "file.jpg", a keyword symbol as
returned in the car of the list of attachments, .e.g. :|file.jsp|, or
one of the elements of a document’s attachment list,
e.g: (:|file.jsp| (:|stub| . T) (:|content_type|
. "image/jpeg") (:|length| . 3543434)).
If the path identifies a directory then the target file will be created in that directory with the same name as the attachment in the document. If the path ends with a file name the attachment will be created with that name.
Set top-level connection information. The port may be specified as a string or number. As of CouchDb version 7.2 the default port is 5984, prior to that it was 8888.
Set a property of a document. If the named property does not exist, add it to the document, otherwise change the existing value. Does not destructively modify input document, so be sure to use return value.
Error raised when specified attachment is not found
:attachments
This slot is read-only.
Error raised when no document matching ID is found
Parameters for the changes function.
Default database name
CouchDb server host name
The IANA assigned CouchDb port
http or https
The package where json-symbols are interned. Default keyword, nil = current package
Defined to instruct Drakma to treat json responses as text
Definitions for how invoke-view keyword parameters are translated into CouchDb parameters
Shorthand for (concatenate ’string)
A version of DEFCONSTANT for /strict/ CL implementations.
Define a parenscript function in the object format used by CouchDb. Specifically, a property name associated with a lambda. E.g.: {’foo’ : function () {...}}
Wrap request in code to check for errors due to non-existant data bases. This is necessary because in a document operation, CouchDb does not distinguish between an error due to a missing document and a missing database.
Create a view using parenscript
URL-encode a string. Use drakma’s url-encode since it’s exported now
Add an admin user.
Add lists in list-defs to design document identified by design-doc-id. If the document does not exist, create it. If any list function definitions already exist in the document, update them.
Add CouchDb lists in list-defs to document identified by id. If the document does not exist, create it. If any list function definitions already exist in the document, update them.
Add CouchDb lists in list-defs to document identified by id. If the document does not exist, create it. If any list function definitions already exist in the document, update them.
Return true if expression is, or really looks like, an associative list. Dead giveaways include cons elements in the list that begin with a keyword. Returns the element that produced a positive result, or nil.
Compact named view
Convert string to specified encoding. This may be totally wrong and probably way too inefficient, but it seems to work.
Used by most Clouchdb APIs to make the actual REST request.
Reads a json element from stream
Only objects or arrays on top level, no junk afterwards.
Convert a document in the form of a hash table into an associative list
Encode document to stream with special support for detecting and handling associative lists.
Optionally invoke specified function with supplied document, used to invoke user-specified hook functions.
Wrap specified value in double quotes.
Encode the list of attachements, return them in an _attachments document fragment.
Encode a file in the format suitable for CouchDb attachments
Return specified design document, creating it if it does not already exist.
Return "false" if value is nil, otherwise nil
Get cookie based login user information.
Get database statistics overview.
Read a json document from eiter a stream or a string. If the source is a stream close the stream before returning. Return a document.
Return true if element is a list that begins with a keyword. This is used to help determine associative list-ness.
Convert a keword symbol that may contain hyphen characters to a lower case string with any hyphens replaced by underscores: ’:all-the-best’ -> ’all_the_best’.
Logout cookie based session.
Return user name password values or nil if no user name specified for db
Make a database identifier from either a string or db structure.
Return a URI containing protocol://host:port/ and the concatenation of the remaining parameters.
Do cookie based login.
Join list of strings into a single result. Strings are delimited by specified delimiter. If ignore-nil is true, then nil strings in the list are skipped, and no delimiter is output.
Use a keyword transformation table to traslate between function keyword parameter names and values, and URL parameter names and values.
Transform each keyword parameter using the specified set of options, use only those transformations that return a non-nil result.
Return "true" if value is non-nil, otherwise nil
Validation for ps-view definition
Clean up old view data
General function called by view functions
attachment-missing
)) ¶attachment-missing
)) ¶db-existential-error
)) ¶db
.
authorization-error
)) ¶db
.
invalid-type
)) ¶invalid-id
)) ¶invalid-type
)) ¶ps-view-def-error
)) ¶db-existential-error
)) ¶authorization-error
)) ¶db-existential-error
)) ¶text
.
authorization-error
)) ¶uri
.
invalid-document
)) ¶The base type of all errors signaled by clouchdb
error
.
:description
This slot is read-only.
error
.
Error raised for invalid ps-view definition
:ps-view-def
This slot is read-only.
structure-object
.
Jump to: | (
A B C D E F G I J K L M N P Q R S T U V W |
---|
Jump to: | (
A B C D E F G I J K L M N P Q R S T U V W |
---|
Jump to: | *
+
A C D H I N P R S T U V |
---|
Jump to: | *
+
A C D H I N P R S T U V |
---|
Jump to: | A C D E F I J P S |
---|
Jump to: | A C D E F I J P S |
---|