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:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the data store to retrieve |
| version | string | No | Specific 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:
| Name | Type | Required | Description |
|---|---|---|---|
| options | json | No | Options: {latestOnly?} |
Examples:
# Get all data stores
npx @eventcatalog/sdk getDataStores
writeDataStore​
Writes a data store to EventCatalog
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| options | json | No | Options: {path?, override?, versionExistingContent?} |
writeDataStoreToService​
Writes a data store to a specific service
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| dataStore | json | Yes | Data store object |
| service | json | Yes | Service reference: {id, version?} |
rmDataStore​
Removes a data store by its path
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| path | string | Yes | Path to the data store |
Examples:
# Remove a data store
npx @eventcatalog/sdk rmDataStore "/orders-db"
rmDataStoreById​
Removes a data store by its ID
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the data store to remove |
| version | string | No | Specific 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:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The 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:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the data store |
| file | json | Yes | File object: {content, fileName} |
| version | string | No | Specific version |
dataStoreHasVersion​
Checks if a specific version of a data store exists
Arguments:
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | The ID of the data store |
| version | string | Yes | Version to check |
Examples:
# Check if version exists
npx @eventcatalog/sdk dataStoreHasVersion "orders-db" "1.0.0"