Copy as Markdown[View as Markdown](/docs/sdk/functions/getDataStore.md)

***

# Function: getDataStore()

> **getDataStore**(`directory`): (`id`, `version`?) => `Promise`<`Container`>

Defined in: data-stores.ts:22

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

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter  | Type     |
| ---------- | -------- |
| `id`       | `string` |
| `version`? | `string` |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`Container`>

## Examples[​](#examples "Direct link to Examples")

```
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');
```

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

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

// Gets the latest version of the container
const container = await getContainer('User');

// Gets a version of the entity
const container = await getContainer('User', '0.0.1');
```
