MCPcopy Index your code
hub / github.com/prest/prest

github.com/prest/prest @v2.0.0-rc6 sqlite

repository ↗ · DeepWiki ↗ · release v2.0.0-rc6 ↗
1,044 symbols 4,819 edges 116 files 554 documented · 53%
README

pRESTd

Tests GoDoc Go Report Card codecov Homebrew Discord

pREST (PostgreSQL REST), is a simple production-ready API, that delivers an instant, realtime, and high-performance application on top of your existing or new Postgres database.

PostgreSQL version 9.5 or higher

Contributor License Agreement - CLA assistant

pREST - instant, realtime, high-performance on PostgreSQL | Product Hunt

Problems we solve

The pREST project is the API that addresses the need for fast and efficient solution in building RESTful APIs on PostgreSQL databases. It simplifies API development by offering:

  1. A lightweight server with easy configuration;
  2. Direct SQL queries with templating in customizable URLs;
  3. Optimizations for high performance;
  4. Enhanced developer productivity;
  5. Authentication and authorization features;
  6. Pluggable custom routes and middlewares.

Overall, pREST simplifies the process of creating secure and performant RESTful APIs on top of your new or old PostgreSQL database.

Read more.

Why we built pREST

When we built pREST, we originally intended to contribute and build with the PostgREST project, although it took a lot of work as the project is in Haskell. At the time, we did not have anything similar or intended to keep working with that tech stack. We've been building production-ready Go applications for a long time, so building a similar project with Golang as its core was natural.

Additionally, as Go has taken a huge role in many other vital projects such as Kubernetes and Docker, and we've been able to use the pREST project in many different companies with success over the years, it has shown to be an excellent decision.

1-Click Deploy

Heroku

Deploy to Heroku and instantly get a realtime RESTFul API backed by Heroku Postgres:

Deploy to Heroku

Documentation

Visit https://docs.prestd.com/

Testing

Run the test suite inside Docker (no local Postgres required):

make test

Or directly with Docker Compose:

docker compose -f docker-compose-test.yml up --abort-on-container-exit --exit-code-from tests
docker compose -f docker-compose-test.yml down -v --remove-orphans

The tests service runs ./testdata/runtest.sh, provisioning databases and executing Go tests.

Example: Docker Build

You can build the Docker image locally for development (this compiles the code from source):

docker build -t prest/prest:latest .

For release builds, GoReleaser uses the same Dockerfile / Dockerfile.noplugins with a pre-built prestd binary (no go.mod in the build context). Local source builds pass version metadata via build arguments:

docker build \
  --build-arg VERSION=v1.0.0 \
  --build-arg COMMIT=hash \
  --build-arg DATE=2026-02-11 \
  -t prest/prest:latest .

Extension points exported contracts — how you extend this code

DatabaseRegistry (Interface)
DatabaseRegistry is re-exported for handler helpers. [6 implementers]
controllers/helpers.go
QueryExecutor (Interface)
QueryExecutor runs SQL statements against the database. [6 implementers]
adapters/query_executor.go
DatabaseRegistry (Interface)
DatabaseRegistry tracks the active database connection name. [6 implementers]
adapters/database_registry.go
CatalogQuerier (Interface)
CatalogQuerier builds SQL for listing databases, schemas, and tables. [6 implementers]
adapters/catalog.go
RequestQueryBuilder (Interface)
RequestQueryBuilder parses HTTP request query parameters into SQL fragments. [6 implementers]
adapters/request_query.go
ScriptRunner (Interface)
ScriptRunner loads and parses user-defined SQL scripts. [6 implementers]
adapters/scripts.go
PermissionsChecker (Interface)
PermissionsChecker validates table and field access for users. [6 implementers]
adapters/permissions.go
SQLBuilder (Interface)
SQLBuilder assembles CRUD SQL statements. [6 implementers]
adapters/sql_builder.go

Core symbols most depended-on inside this repo

Err
called by 146
adapters/scanner.go
Bytes
called by 83
adapters/scanner.go
jsonError
called by 66
controllers/errors.go
EXPECT
called by 60
adapters/mockgen/request_query_builder.go
Close
called by 56
adapters/mock/conn.go
EXPECT
called by 55
adapters/mockgen/scanner.go
Query
called by 52
adapters/query_executor.go
NewMockQueryExecutor
called by 41
adapters/mockgen/query_executor.go

Shape

Function 495
Method 470
Struct 63
Interface 13
TypeAlias 2
FuncType 1

Languages

Go100%

Modules by API surface

adapters/mockgen/adapter.go116 symbols
adapters/postgres/postgres.go86 symbols
adapters/mock/mock.go63 symbols
integration/adapters/postgres/postgres_test.go58 symbols
middlewares/middlewares_test.go48 symbols
adapters/mockgen/query_executor.go40 symbols
adapters/mockgen/request_query_builder.go26 symbols
adapters/mockgen/catalog_querier.go26 symbols
adapters/postgres/postgres_test.go25 symbols
controllers/auth.go22 symbols
controllers/crud_test.go21 symbols
controllers/auth_test.go21 symbols

Dependencies from manifests, versioned

github.com/avelino/slugifyv0.0.0-2018050114592 · 1×
github.com/clbanning/mxjv1.8.4 · 1×
github.com/davecgh/go-spewv1.1.2-0.20180830191 · 1×
github.com/decred/dcrd/dcrec/secp256k1/v4v4.4.0 · 1×
github.com/go-viper/mapstructure/v2v2.5.0 · 1×
github.com/golang/mockv1.6.0 · 1×
github.com/gosidekick/migration/v3v3.0.0 · 1×
github.com/inconshreveable/mousetrapv1.1.0 · 1×

Datastores touched

dbnameDatabase · 1 repos

For agents

$ claude mcp add prest \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact