Skip to main content

Data Stores CLI Commands

Manage data stores in your EventCatalog from the command line.

getDataStore​

Returns a data store from EventCatalog by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data store to retrieve
versionstringNoSpecific version to retrieve

Examples:

# Get the latest data store
npx @eventcatalog/sdk getDataStore "orders-db"

# Get a specific version
npx @eventcatalog/sdk getDataStore "orders-db" "1.0.0"

getDataStores​

Returns all data stores from EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {latestOnly?}

Examples:

# Get all data stores
npx @eventcatalog/sdk getDataStores

writeDataStore​

Writes a data store to EventCatalog

Arguments:

NameTypeRequiredDescription
optionsjsonNoOptions: {path?, override?, versionExistingContent?}

writeDataStoreToService​

Writes a data store to a specific service

Arguments:

NameTypeRequiredDescription
dataStorejsonYesData store object
servicejsonYesService reference: {id, version?}

rmDataStore​

Removes a data store by its path

Arguments:

NameTypeRequiredDescription
pathstringYesPath to the data store

Examples:

# Remove a data store
npx @eventcatalog/sdk rmDataStore "/orders-db"

rmDataStoreById​

Removes a data store by its ID

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data store to remove
versionstringNoSpecific version to remove

Examples:

# Remove a data store
npx @eventcatalog/sdk rmDataStoreById "orders-db"

versionDataStore​

Moves the current data store to a versioned directory

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data store to version

Examples:

# Version a data store
npx @eventcatalog/sdk versionDataStore "orders-db"

addFileToDataStore​

Adds a file to a data store

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data store
filejsonYesFile object: {content, fileName}
versionstringNoSpecific version

dataStoreHasVersion​

Checks if a specific version of a data store exists

Arguments:

NameTypeRequiredDescription
idstringYesThe ID of the data store
versionstringYesVersion to check

Examples:

# Check if version exists
npx @eventcatalog/sdk dataStoreHasVersion "orders-db" "1.0.0"