# Data

> Managed Postgres, Redis, full-text search, and object storage, provisioned per project with no external signup.

Data services are built in and provisioned per project — no external accounts, no separate billing. Connection strings are encrypted at rest (AES-256-GCM) and fetched on demand; the CLI never persists them beyond the lifetime of a command.

## Services

| Service | Purpose |
| --- | --- |
| PostgreSQL | Primary relational database with connection pooling |
| Redis | Cache, pub/sub, and sessions |
| Object storage | S3-compatible object storage (MinIO) |
| Full-text search | Search over your data (Meilisearch) |

> **Honest note.** Postgres and Redis are the core MVP data services. Object storage and search are available too; ClickHouse-based analytics is on the roadmap. If your project has more than one service of a kind, tools and commands take an explicit target.

## Postgres

```bash
primdb db                 # open a psql shell on the production DB
primdb db --preview       # connect to the preview DB
primdb db push            # push a Drizzle schema (drizzle-kit push)
primdb db migrate         # run pending migrations on production
primdb db status          # list pending migrations
primdb db rollback        # roll back the last applied migration
primdb db studio          # open Drizzle Studio, tunneled to your browser
primdb db backup          # create a manual backup snapshot
primdb db restore <id>    # restore the DB from a backup
```

## Redis

```bash
primdb redis cli              # open redis-cli on production
primdb redis cli --preview    # connect to preview Redis
primdb redis flush --preview  # flush the preview DB (blocked on production)
```

## Object storage

```bash
primdb storage ls                     # list objects
primdb storage ls --prefix uploads/   # list under a prefix
primdb storage upload <file>          # upload (key = filename)
primdb storage upload <file> --key custom/path.jpg
primdb storage url <key>              # print an object URL
primdb storage rm <key>               # delete an object
```

## From an agent

Over MCP, agents call `query_sql` and `list_tables` for Postgres, `redis_get` / `redis_set` / `redis_del` / `redis_keys` for Redis, and `storage_list` / `storage_get_url` / `storage_put_text` / `storage_delete` for storage — all scoped to one project. See [MCP](https://primdb.com/docs/mcp).

---

Source: https://primdb.com/docs/data
