ektorp

0.0.1-alpha8 • Public • Published

Ektorp

Some assembly required.

Ektorp is a node.js library and command-line utility for building your CouchDB.

Project Status

Ektorp is incomplete but we have a number of tests, and most of them are passing. :-)

Build Status

Using Ektorp

From the command-line:
  1. Install ektorp globally:

    $ npm install -g ektorp

  2. Run ektorp:

    $ ektorp http://localhost:5984/new_db ./migrations

  3. Relax!

From your own code:

To integrate ektorp and control more aspects of the migration:

  1. Install ektorp (doesn't need to be installed globally if you don't want to use the CLI tool):

    $ npm install ektorp

  2. Leverage ektorp in your own bootstrap script:

    var ektorp = require('ektorp');
    
    //pass the url to the DB you want to upgrade, and the path to migrations:
    var migrator = ektorp('http://localhost:5984/new_db', './migrations');
    
    migrator.on('done', function(){ console.log('Migrations are done!'); });
    
    //cause the migrator to start.
    migrator.start();
    

How do I write a migration?

Here's one way that is supported (there are others that will be documented soon):

  1. Create a directory:

    $ mkdir ./migrations

  2. Make a migration:

    $ cd ./migrations
    $ touch 201401310849_first_migration.json
    
  3. You can put a JSON array or object in 201401310849_first_migration.json, it will be pushed to the database when you run ektorp.

Readme

Keywords

none

Package Sidebar

Install

npm i ektorp

Weekly Downloads

1

Version

0.0.1-alpha8

License

BSD-2-Clause

Last publish

Collaborators

  • atheken