CouchDB::Deploy - Simple configuration scripting to deploy CouchDB databases
This module attempts to help with the common issue of deploying databases and updates to database schemata in distributed development settings (which can simply be when you have your own dev box and a server to deploy to).
CouchDB does not have schemata, but it does have views (in design documents) on which methods in your code are likely to rely. At times, you may also wish to have a given document in a database, say the default configuration.
What this module does is:
Currently this is done in Perl, using simple syntax sugar but it is expected that it will be updated to also support a Config::Any approach.
Creates a database with the given name, and adds the content, unless it exists. Keep in mind that CouchDB databases must have a trailing slash in their names.
Creates a document with that content, unless it is there and up to date. Note that currently only documents with an _id field are supported (otherwise we couldn't do the create-unless-exists logic). The content is of the exact same structure as the JSON one would post to CouchDB.
Reads the file at $PATH, converts it to base64, and returns that on a single line. This is a helper made to assist in creating CouchDB attachments. Note that in the current state it will read the file into memory.
Returns the content encoded in single-line Base 64.
Creates a design document with those views and parameters, unless it is there and up to date. The content is of the exact same structure as the JSON one would post to CouchDB, except that if the
_id field does not start with
_design/ it will be automatically added.
Robin Berjon, <robin @t berjon d.t com>
Please report any bugs or feature requests to bug-couchdb-deploy at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CouchDb-Deploy.
Copyright 2008 Robin Berjon, all rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.