> ## Documentation Index
> Fetch the complete documentation index at: https://docs.assistantscenter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Driver

> Starting from 1.5.0-beta.1, you are able to use database drivers! This means you can use MongoDB, MySQL, etc for your storage needs. This will store everything that needs to be persistent. (Feeds are stored separately)

## Database Driver Options

Because we use Keyv, you are able to set your database driver to anything Keyv supports.

The list of options are available at [https://www.npmjs.com/package/keyv](https://www.npmjs.com/package/keyv) but we will provide the two most common ones in this guide.

## Defaults

The default storage adapter (the type of storage) is SQLite which will store your data in a file, if you use Git then this file will most likely be overwritten when you make an update to your files.

## Setting a Database Driver

To set a database driver, add this bit of code to the theme config.

```js theme={null}
theme: SoftUI({
    dbdriver: String;
})
```

### MongoDB

To add a driver like MongoDB you need to install the adapter with this command.

<CodeGroup>
  ```bash npm theme={null}
  npm install --save @keyv/mongo
  ```

  ```bash yarn theme={null}
  yarn add --save @keyv/mongo
  ```

  ```bash pnpm theme={null}
  pnpm add --save @keyv/mongo
  ```

  ```bash bun theme={null}
  bun add --save @keyv/mongo
  ```
</CodeGroup>

And then set the driver to your connection string such as this.

```js theme={null}
theme: SoftUI({
    dbdriver: "mongodb://localhost:27017/yourdb";
})
```

### MySQL

To add a driver like MySQL you need to install the adapter with this command.

<CodeGroup>
  ```bash npm theme={null}
  npm install --save @keyv/mysql
  ```

  ```bash yarn theme={null}
  yarn add --save @keyv/mysql
  ```

  ```bash pnpm theme={null}
  pnpm add --save @keyv/mysql
  ```

  ```bash bun theme={null}
  bun add --save @keyv/mysql
  ```
</CodeGroup>

And then set the driver to your connection string such as this.

```js theme={null}
theme: SoftUI({
    dbdriver: "mysql://user:pass@localhost:3306/dbname";
})
```
