umzug-storage-cassandra
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.5 • Public • Published

    umzug-storage-cassandra

    Badges

    CodecovGitHubCodacy gradenpmGitHub package.json version

    Summary

    This package implements the umzug storage interface for cassandra. This allows using umzug for cassandra migrations and storing the migration log in cassandra.

    How to use

    Install using either npm or yarn, npm install umzug-storage-cassandra --save or yarn add umzug-storage-cassandra --save.

    Once installed you can pass it to umzug like this:

    import {Client} from 'cassandra-driver';
    import {CassandraStorage} from 'umzug-storage-cassandra';
    
    const cassandraClient:Client = new Client({
        contactPoints: ['node'],
        localDataCenter: 'dc1',
        keyspace: 'umzug'
    });
    
    const cassandraStorage:CassandraStorage = new CassandraStorage({
        client: cassandraClient
    })
    
    const umzugOptions = {
      storage: cassandraStorage
    }

    You will need to manage/create the keyspace prior to using this for the migration log. See below for an example of creating the keyspace.

    import {Client} from 'cassandra-driver';
    
    const cassandraClient:Client = new Client({
        contactPoints: ['node'],
        localDataCenter: 'dc1'
    });
    
    await cassandraClient.execute(`CREATE KEYSPACE IF NOT EXISTS umzug
        WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};`);

    This library only works the datastax cassandra-driver client.

    Install

    npm i umzug-storage-cassandra

    DownloadsWeekly Downloads

    8

    Version

    0.1.5

    License

    MIT

    Unpacked Size

    14.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • akboyd88