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

# Database

The v6 repository README identifies MySQL as the database and TypeORM as the ORM. The `.env.example` configures the connection using `TYPEORM_CONNECTION`, `TYPEORM_HOST`, `TYPEORM_PORT`, `TYPEORM_USERNAME`, `TYPEORM_PASSWORD`, and `TYPEORM_DATABASE`.

## Provisioning

Create a database using the charset/collation supported by the release and a dedicated application user. Grant only required runtime privileges; use a separate migration identity where practical.

```sql theme={null}
CREATE DATABASE <database_name>;
```

The command is illustrative. Choose charset/collation based on the project's schema and deployment requirements.

## ORM configuration

The environment template sets `TYPEORM_CONNECTION=mysql` and includes entity and migration discovery paths. It also exposes `TYPEORM_SYNCHRONIZE` and query logging configuration. Verify the actual runtime configuration loader before relying on any variable.

## Data lifecycle

Use versioned migrations for schema changes. Back up before migrations and destructive maintenance. Test restore procedures, indexes, foreign keys, collation, transaction behavior, and query plans on a staging copy.

## Security and operations

Do not expose MySQL publicly. Require network controls, strong credentials, TLS where available, least privilege, encrypted backups, monitoring, and a documented retention policy. Avoid logging SQL parameters containing personal or secret data.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.