Skip to content
Back to search

prest

PostgreSQL ➕ REST, low-code, simplify and accelerate development, ⚡ instant, realtime, high-performance on any Postgres application, existing or new, MCP server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/prest/prest with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/prest/prest'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/prest--prest/badge.svg)](/listings/prest--prest)

HTML

<a href="/listings/prest--prest"><img src="/api/listings/prest--prest/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install and run options (Docker, Homebrew, or Go) are documented in [Get pREST](https://docs.prestd.com/get-prest). Point pREST at Postgres (`PREST_PG_URL` or `pg.*` / `DATABASE_URL`), then call:

GET /{database}/{schema}/{table}

See [Configuring pREST](https://docs.prestd.com/get-started/configuring-prest) for auth, ACL, custom queries, and MCP.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 257 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # pRESTd
  2. [![Unit tests](https://github.com/prest/prest/actions/workflows/test-unit.yml/badge.svg)](https://github.com/prest/prest/actions/workflows/test-unit.yml)
  3. [![Go Reference](https://pkg.go.dev/badge/github.com/prest/prest/v2.svg)](https://pkg.go.dev/github.com/prest/prest/v2)
  4. [![Go Report Card](https://goreportcard.com/badge/github.com/prest/prest)](https://goreportcard.com/report/github.com/prest/prest)
  5. [![codecov](https://codecov.io/gh/prest/prest/branch/main/graph/badge.svg?token=eVD9urwIEv)](https://codecov.io/gh/prest/prest)
  6. [![Homebrew](https://img.shields.io/badge/dynamic/json.svg?url=https://formulae.brew.sh/api/formula/prestd.json&query=$.versions.stable&label=homebrew)](https://formulae.brew.sh/formula/prestd)
  7. [![Discord](https://img.shields.io/badge/discord-prestd-blue?logo=discord)](https://discord.gg/JnRjvu39w8)
  8. _p_**REST** (**P**_ostgreSQL_ **REST**) is a production-ready API that delivers instant REST and Model Context Protocol (MCP) APIs on your existing or new SQL database — CRUD, custom SQL routes, auth, ACL, and a read-only MCP endpoint — without hand-writing a backend.
  9. PostgreSQL 9.5+ is the default engine. **MySQL 8.0.19+** is a separate native dialect from [v2.5.0](https://docs.prestd.com/releases/v2.5.0). Read-only MCP on MySQL is [v2.5.1](https://docs.prestd.com/releases/v2.5.1). Set `engine = "mysql"` to select it. An unset `engine` stays PostgreSQL. MariaDB, TiDB, and Aurora MySQL stay on the [roadmap](https://docs.prestd.com/databases/roadmap).
  10. > PostgreSQL 9.5+ (default). MySQL 8.0.19+ with `engine = "mysql"`.
  11. Contributor License Agreement — [![CLA assistant](https://cla-assistant.io/readme/badge/prest/prest)](https://cla-assistant.io/prest/prest)
  12. <a href="https://www.producthunt.com/posts/prest?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-prest" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=303506&theme=light" alt="pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
  13. ## Documentation
  14. **Full documentation lives at [docs.prestd.com](https://docs.prestd.com/).**
  15. | Topic | Link |
  16. |-------|------|
  17. | Get pREST (Docker, Homebrew, Go) | [Get pREST](https://docs.prestd.com/get-prest) |
  18. | Configuration | [Configuring pREST](https://docs.prestd.com/get-started/configuring-prest) |
  19. | API reference | [API Reference](https://docs.prestd.com/api-reference) |
  20. | MCP over HTTP | [MCP over HTTP](https://docs.prestd.com/get-started/mcp-over-http) |
  21. | Multi-database | [Multi-database](https://docs.prestd.com/get-started/multi-database) |
  22. | Databases & roadmap | [Databases](https://docs.prestd.com/databases) · [Roadmap](https://docs.prestd.com/databases/roadmap) |
  23. | MySQL 8 | [MySQL](https://docs.prestd.com/databases/mysql) · [v2.5.1](https://docs.prestd.com/releases/v2.5.1) |
  24. | AI clients (Cursor, Claude, …) | [AI and MCP](https://docs.prestd.com/ai) |
  25. ## Quick start
  26. Install and run options (Docker, Homebrew, or Go) are documented in [Get pREST](https://docs.prestd.com/get-prest). Point pREST at Postgres (`PREST_PG_URL` or `pg.*` / `DATABASE_URL`), then call:
  27. ```http
  28. GET /{database}/{schema}/{table}
  29. ```
  30. MySQL 8.0.19+ uses the same path. `{schema}` is the MySQL database. Set the engine and a `mysql://` URL. The port defaults to 3306 when unset. `PREST_DB_*` is read first, then the legacy `PREST_PG_*` names:
  31. ```toml
  32. engine = "mysql"
  33. [pg]
  34. url = "mysql://user:pass@localhost:3306/mydb"
  35. ```
  36. ```sh
  37. export PREST_ENGINE=mysql
  38. export PREST_DB_URL='mysql://user:pass@localhost:3306/mydb'
  39. ```
  40. A missing user or database fails startup. Postgres defaults (user `postgres`, database `prest`, port 5432) are not copied onto a MySQL engine. Guide: [MySQL](https://docs.prestd.com/databases/mysql).
  41. Set `PREST_PG_TIMEZONE` (IANA name, e.g. `America/Sao_Paulo`) to choose the PostgreSQL session TimeZone; see [`samples/prest.sample.toml`](samples/prest.sample.toml). Postgres and TimescaleDB only; MySQL ignores it.
  42. Set `PREST_HTTP_ALLOWED_HOSTS` (or `http.allowed_hosts`) to the host names pREST serves, e.g. `api.example.com,.example.org`, to answer any other `Host` header with 400 Bad Request; see [`samples/prest.sample.toml`](samples/prest.sample.toml). Unset, every host is served.
  43. Set `PREST_HTTP_REQUEST_ID_HEADER` (or `http.request_id_header`) to a header name such as `X-Request-Id` to give every request a correlation ID: the ID a client or proxy sent in that header is kept, otherwise one is generated, and it is returned in the same response header and logged at the end of each access log line; see [`samples/prest.sample.toml`](samples/prest.sample.toml). Unset, no request ID is added.
  44. See [Configuring pREST](https://docs.prestd.com/get-started/configuring-prest) for auth, ACL, custom queries, and MCP.
  45. ### Configuration as JSON
  46. Containers can run without a mounted `prest.toml`. Put the application config (auth, JWT, ACL, queries, cache, CORS, …) in one JSON document in `PREST_CONFIG_JSON`, and keep the listener and database settings in their usual env vars:
  47. ```sh
  48. prestd config export-json -f prest.toml > app-config.json
  49. kubectl create secret generic prest-app-config --from-file=config.json=app-config.json
  50. ```
  51. ```sh
  52. export PREST_PG_URL='postgres://user:pass@db:5432/prest'
  53. export PREST_CONFIG_JSON="$(cat app-config.json)"
  54. # or, where multi-line values get mangled:
  55. export PREST_CONFIG_JSON_B64="$(base64 < app-config.json | tr -d '\n')"
  56. ```
  57. - The document is merged over `prest.toml` when there is one. An array replaces the file's array whole, and a `null` is skipped. `PREST_*` env vars still override the document.
  58. - `[http]`, `[https]`, `engine`, `[pg]`, `[mysql]`, `[[databases]]` and `queries.location` are never read from it: they are ignored with a warning, so a stale export cannot move the port or switch the database.
  59. - A document that is not a valid JSON object, is over 1 MiB, or puts a value where a table belongs (or the reverse) fails startup instead of falling back to defaults.
  60. - The export can hold secrets such as `jwt.key`. Store it as a secret.
  61. ## Serving several databases
  62. pREST can serve multiple databases in two modes:
  63. ### Registry mode
  64. Define a `[[databases]]` registry in `prest.toml` or use environment variables (`DATABASE_ALIAS_<n>` / `DATABASE_URL_<n>`). Aliases may differ from database names, and entries can be on the same host or different hosts:
  65. ```toml
  66. [[databases]]
  67. alias = "main"
  68. url = "postgres://user:pass@localhost:5432/prest_main?sslmode=disable"
  69. [[databases]]
  70. alias = "tenant-1"
  71. url = "postgres://user:pass@localhost:5432/tenant_1?sslmode=disable"
  72. [[databases]]
  73. alias = "reporting"
  74. url = "mysql://user:pass@127.0.0.1:3306/reports?tls=false"
  75. ```
  76. Or via environment:
  77. ```sh
  78. DATABASE_ALIAS_1=main
  79. DATABASE_URL_1="postgres://user:pass@localhost:5432/prest_main?sslmode=disable"
  80. DATABASE_ALIAS_2=tenant-1
  81. DATABASE_URL_2="postgres://user:pass@localhost:5432/tenant_1?sslmode=disable"
  82. ```
  83. An entry that is unreachable at start-up is logged and answers 503 ("database unavailable") until it comes up; start-up fails only when every entry is unreachable or the configuration is invalid.
  84. ### No-registry mode
  85. Use `pg.database` plus `pg.allowed_databases` on the `[pg]` host with the `[pg]` credentials. Both Postgres and MySQL are supported. On MySQL, `{schema}` must equal `{database}`:
  86. ```toml
  87. [pg]
  88. database = "prest"
  89. allowed_databases = ["secondary-db"]
  90. ```
  91. Or via environment (comma-separated for allowed databases):
  92. ```sh
  93. PREST_PG_DATABASE=prest
  94. PREST_PG_ALLOWED_DATABASES=secondary-db,another-db
  95. # or for MySQL:
  96. PREST_DB_DATABASE=mydb
  97. PREST_DB_ALLOWED_DATABASES=other-db
  98. ```
  99. ### Catalog and MCP
  100. The `/databases` endpoint and MCP `prest.list_databases` show only the served databases. In registry mode, that is the configured aliases. Without a registry, that is `pg.database` plus `pg.allowed_databases`.
  101. Postgres supports up to 64 open pools. MySQL creates one pool per served database.
  102. ### Migrating from `pg.single`
  103. The `pg.single` configuration key has been removed and is ignored with a warning. Behavior changes:
  104. - **Allow-listed names are always served.** Previously, `pg.single = true` (the default) required requests to be for the main `pg.database`; allow-listed names were ignored. Now they are served whether the deprecated key is set or not.
  105. - **A registry is no longer limited to `pg.database`.** Previously, with both a registry and `pg.single = true`, every request was restricted to the main database. Now a registry serves its configured aliases freely.
  106. - **`/databases` and MCP list only served databases.** Requests for unlisted databases return 400 "database not registered".
  107. - **On MySQL without a registry, `/{database}/{other-schema}/…` returns 404.** On MySQL a schema is a database, so `{schema}` must equal `{database}`. Previously any database the MySQL user had grants on was reachable through `pg.database`.
  108. ## Passing values to query scripts
  109. Values a `_QUERIES` script template interpolates become part of the SQL text, so
  110. pREST screens them: anything carrying quotes, `--`, `::`, or — for multi-word
  111. values — a SQL keyword is refused, and a refused value that is interpolated fails
  112. the request with `400`.
  113. Bind free-form values instead, and the screen does not apply at all. On PostgreSQL,
  114. a bound value travels to the database out of band, where it can never be parsed as SQL:
  115. ```sql
  116. -- interpolated: screened, and rejected for values like 'compra do mes'
  117. SELECT * FROM articles WHERE slug = '{{.slug}}'
  118. -- bound: the caller's value arrives verbatim, whatever it contains
  119. SELECT * FROM articles WHERE slug = {{sqlVal "slug"}}
  120. ```
  121. | Helper | Use for | Renders |
  122. |--------|---------|---------|
  123. | `{{sqlVal "key"}}` | a single value | `$1` |
  124. | `{{sqlList "key"}}` | a repeated query parameter (`?tag=a&tag=b`) | `($1,$2)` |
  125. | `{{ident "key"}}` | a table/column name, which cannot be bound | `"public"."users"` |
  126. That table is the PostgreSQL rendering. On MySQL, `{{sqlVal "key"}}` renders `?`, `{{sqlList "key"}}` renders `(?,?)`, and `{{ident "key"}}` renders backtick names such as `` `shop`.`users` ``. With the default `prepare = false`, MySQL interpolates those `?` placeholders into the statement. `prepare = true` uses binary prepared statements, and then the values travel out of band.
  127. `sqlVal` and `sqlList` also reach headers as `{{sqlVal "header.X-Application"}}`.
  128. Credential headers (`Authorization`, `Cookie`, …) are always withheld.
  129. Prefer binding for anything user-supplied — search phrases especially, since a
  130. phrase containing a common word such as `do`, `as` or `or` is exactly what the
  131. interpolation screen refuses.
  132. ## 1-Click Deploy
  133. ### Heroku
  134. Deploy to Heroku and get a realtime RESTful API backed by Heroku Postgres:
  135. [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/prest/prest-heroku)
  136. More: [Deploy in Heroku](https://docs.prestd.com/deployment/deploy-in-heroku).
  137. ## Contributing
  138. Contributions are welcome. See the [Development Guide](https://docs.prestd.com/get-prest/development-guide) and [Contributing to pREST](https://docs.prestd.com/readme/contributing-to-prestd). Please sign the [CLA](https://cla-assistant.io/prest/prest).
  139. Questions? [GitHub Discussions](https://github.com/prest/prest/discussions) or [Discord](https://discord.gg/JnRjvu39w8).
  140. ## Testing
  141. Run unit tests locally:
  142. ```bash
  143. make test-unit
  144. ```
  145. Run integration suites inside Docker (no local database required):
  146. ```bash
  147. # Postgres (full stack: default, auth, multicluster, queries) — also: make test-integration
  148. make test-integration-postgres
  149. # TimescaleDB (Timescale-specific E2E only)
  150. make test-integration-timescaledb
  151. # MySQL 8 (./integration/mysql/... only). Default image mysql:8.4.
  152. # Override: MYSQL_IMAGE=mysql:8.0 make test-integration-mysql
  153. make test-integration-mysql
  154. ```
  155. Or with Docker Compose:
  156. ```bash
  157. docker compose -f integration/postgres/docker-compose.yml up -d --wait \
  158. postgres postgres-b db-init prestd prestd-multicluster prestd-auth prestd-queries
  159. docker compose -f integration/postgres/docker-compose.yml run --rm --no-deps tests
  160. docker compose -f integration/postgres/docker-compose.yml down -v --remove-orphans
  161. ```
  162. Postgres compose runs `./integration/suites/...` and `./integration/postgres/...`.
  163. TimescaleDB compose runs `./integration/timescaledb/...` only (see `.github/workflows/test-integration-timescaledb.yml`).
  164. MySQL compose runs `./integration/mysql/...` only (see `.github/workflows/test-integration-mysql.yml`). CI runs `mysql:8.0`, `mysql:8.4`, and `mysql:latest`.
  165. Network tests require `PREST_TEST_URL` (and flavor-specific URLs for the Postgres job); outside Compose those tests skip when the URLs are unset.
  166. ## Example: Docker Build
  167. Build the Docker image locally for development (compiles from source):
  168. ```bash
  169. docker build -t prest/prest:latest .
  170. ```
  171. For release builds, GoReleaser uses the same `Dockerfile` / `Dockerfile.noplugins` with a pre-built `prestd` binary. Local source builds can pass version metadata via build arguments:
  172. ```bash
  173. docker build \
  174. --build-arg VERSION=v1.0.0 \
  175. --build-arg COMMIT=hash \
  176. --build-arg DATE=2026-02-11 \
  177. -t prest/prest:latest .
  178. ```

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.