Skip to main content

getDataStore

Callable

  • getDataStore(directory: string): (id: string, version?: string) => Promise<Container>

  • Returns a data store (e.g. database, cache, etc.) from EventCatalog.

    You can optionally specify a version to get a specific version of the data store

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

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

    // Gets the latest version of the data store
    const container = await getDataStore('orders-db');

    // Gets a version of the entity
    const container = await getDataStore('orders-db', '0.0.1');