> For the complete documentation index, see [llms.txt](https://simpldb.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://simpldb.js.org/v1/documentation/database.md).

# Database

Represents the Database structure for SimplDB.

### Constructor

#### new SimplDB(config)

| Parameter            | Default | Description                                                                                                                                                                                                      |
| -------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| config               |         | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></p><p>The configuration to use in the database</p>                                               |
| config.filePath      |         | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></p><p>The path to the JSON file (from the root of the project) where data will be stored</p>     |
| config.encryptionKey | `null`  | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a> (optional)</p><p>The Encryption Key to use for data encryption and decryption</p>                |
| config.saveOnUpdate  | `true`  | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a> (optional)</p><p>Whether or not to write new data to the JSON file everytime it is updated</p> |
| config.tabSize       | `2`     | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">Number</a> (optional)</p><p>The size of the tab before each key (indentation)</p>                           |
