Skip to main content

Function: writeDataStoreToService()

writeDataStoreToService(directory): (container, service, options) => Promise<void>

Defined in: data-stores.ts:168

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

You can optionally override the path of the data store.

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
containerContainer
service{ id: string; version: string; }
service.idstring
service.version?string
options{ format: "md" | "mdx"; override: boolean; path: string; }
options.format?"md" | "mdx"
options.override?boolean
options.path?string

Returns

Promise<void>

Examples

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' });
import utils from '@eventcatalog/utils';

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

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