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

# Database

> Choose between PostgreSQL, Turso with Embedded Replicas, or SQLite

## Implementation

* Database Migration: [AtlasGo](https://atlasgo.io/docs)
* SQL generation: [sqlc](https://sqlc.dev)
* Database: [PostgreSQL](https://www.postgresql.org/), [SQLite](https://www.sqlite.org/index.html), or [Turso](https://turso.tech/)

## Basic Flow

1. Spin up the docker compose.
2. Make changes to the `service-core/storage/schema.sql` file.
3. Run **AtlasGo** migration:

```bash theme={null}
sh scripts/atlas.sh
```

4. Modify `service-core/storage/queries.sql` file.
5. Run **sqlc** to generate the SQL code:

```bash theme={null}
sh scripts/sqlc.sh
```

## Troubleshooting

* When running Docker on WSL2, the SQLite file may not work. In that case, you probably need to exclude it from volumes:

```
    volumes:
      - ./service-code:/serivce
      - /serivce/storage/
    environment:
      DB_PROVIDER: sqlite
      SQLITE_FILE: /service/storage/data.db
```

## Need help?

Visit our discord server to ask any questions, make suggestions and give feedback :).

[https://discord.gg/EdSZbQbRyJ](https://discord.gg/EdSZbQbRyJ)
