Skip to main content

writeDataStoreToService

Callable

  • writeDataStoreToService(directory: string): (container: Container, service: { id: string; version?: string }, options?: { format?: md | mdx; override?: boolean; path?: string }) => Promise<void>

  • Write an data store (e.g. database, cache, etc.) to a service in EventCatalog.

    You can optionally override the path of the data store.

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

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

    // Write a data store to a given service in the catalog
    // Data store would be written to services/Inventory/containers/orders-db
    await writeDataStoreToService({
    id: 'orders-db',
    name: 'Orders DB',
    version: '0.0.1',
    summary: 'This is a summary',
    markdown: '# Hello world',
    container_type: 'database',
    }, { id: 'Inventory' });