1
This is Desktop Couch, an infrastructure to place a CouchDB on every desktop
2
and provide APIs and management tools for applications to store data within
3
it and share that data between computers and to the cloud.
7
== Creating databases, design documents, and views ==
9
Desktop Couch will automatically create databases and design documents for you
10
on startup by inspecting the filesystem, meaning that you do not need to check
11
in your application whether your views exist. It is of course possible to create
12
views directly through the Records API, but having them created via the
13
filesystem allows managing of the view definitions more easily (they are
14
in separately editable files, which helps with version control) and packaging
15
(the files can be separately stored in a distribution package and installed
16
into the system-level XDG_DATA_DIR rather than the user-level folder).
18
=== To create a database ===
20
Create a file $XDG_DATA_DIR/desktop-couch/databases/YOUR_DB_NAME/database.cfg
22
This file can currently be empty (in future it may contain database setup and
23
configuration information).
25
=== To create a design document ===
28
$XDG_DATA_DIR/desktop-couch/databases/YOUR_DB_NAME/_design/DESIGN_DOC_NAME/views/VIEW_NAME/map.js
29
containing the map function from your view.
30
If you also require a reduce function for your view, create a file
31
$XDG_DATA_DIR/desktop-couch/databases/YOUR_DB_NAME/_design/DESIGN_DOC_NAME/views/VIEW_NAME/reduce.js.
33
This is compatible with the filesystem view structure from CouchApp and