Skip to main content

versionDataStore

Callable

  • versionDataStore(directory: string): (id: string) => Promise<void>

  • Version an data store (e.g. database, cache, etc.) by its id.

    Takes the latest data store and moves it to a versioned directory. All files with this data store are also versioned (e.g /containers/orders-db/schema.json)

    @example
    import utils from '@eventcatalog/utils';

    const { versionDataStore } = utils('/path/to/eventcatalog');

    // moves the latest orders-db data store to a versioned directory
    // the version within that data store is used as the version number.
    await versionDataStore('orders-db');