MCPcopy
hub / github.com/postgres-ai/database-lab-engine

github.com/postgres-ai/database-lab-engine @v4.1.3 sqlite

repository ↗ · DeepWiki ↗ · release v4.1.3 ↗
5,901 symbols 21,342 edges 571 files 1,133 documented · 19%
README

Deutsch | Português (BR) | Русский | Español | Українська

DBLab Engine

twitter

⚡ Blazing-fast PostgreSQL cloning and branching 🐘

🛠️ Build powerful dev/test environments.

🔃 Cover 100% of DB migrations with CI tests.

💡 Quickly verify ChatGPT ideas to get rid of hallucinations.

Available for any PostgreSQL, including self-managed and managed services* like AWS RDS, GCP Cloud SQL, Supabase, and Timescale.

It can be installed and used anywhere: across all cloud environments and on-premises.

Latest release

CI pipeline status Go report

Contributor Covenant Community Slack Twitter Follow

Features | Documentation | Blog | Community & Support | Contributing


*For managed PostgreSQL cloud services like AWS RDS or Heroku, direct physical connection and PGDATA access aren't possible. In these cases, DBLab should run on a separate VM within the same region. It will routinely auto-refresh its data, effectively acting as a database-as-a-service solution. This setup then offers thin database branching ideal for development and testing.

Why DBLab?

  • Build dev/QA/staging environments using full-scale, production-like databases.
  • Provide temporary full-size database clones for SQL query analysis and optimization (see also: SQL optimization chatbot Joe).
  • Automatically test database changes in CI/CD pipelines, minimizing risks of production incidents.
  • Rapidly validate ChatGPT or other LLM concepts, check for hallucinations, and iterate towards effective solutions.

For example, cloning a 1 TiB PostgreSQL database takes just about 10 seconds. On a single machine, you can have dozens of independent clones running simultaneously, supporting extensive development and testing activities without any added hardware costs.

Try it yourself right now: - Visit Postgres.ai Console, set up your first organization, and provision a DBLab Standard Edition (DBLab SE) to any cloud or on-premises environment. - Pricing (starting at $62/month) - Documentation: How to install DBLab SE - Demo: https://demo.dblab.dev (use the token demo-token to access) - Looking for a free version? Install the DBLab Community Edition by following this tutorial.

How it works

Thin cloning is fast because it is based on Copy-on-Write (CoW). DBLab employs two technologies for enabling thin cloning: ZFS (default) and LVM.

Using ZFS, DBLab routinely takes new snapshots of the data directory, managing a collection of them and removing old or unused ones. When requesting a fresh clone, users have the option to select their preferred snapshot.

Read more: - How it works - Database Migration Testing - SQL Optimization with Joe Bot - Questions and answers

Where to start

Case studies

Features

  • Speed & scale
    • Blazing-fast cloning of PostgreSQL databases – clone in seconds, irrespective of database size
    • Theoretical max of snapshots/clones: 264 (ZFS, default)
    • Maximum size of PostgreSQL data directory: 256 quadrillion zebibytes, or 2128 bytes (ZFS, default)
  • Support & technologies
    • Supported PostgreSQL versions: 10–18
    • Thin cloning (CoW) technologies: ZFS and LVM
    • UI for manual tasks and API & CLI for automation
    • Packaged in Docker containers for all components
  • PostgreSQL containers
    • Popular extensions including contrib modules, pgvector, HypoPG and many others (docs)
    • Customization capabilities for containers (docs)
    • Docker container and PostgreSQL configuration parameters in the DBLab config
  • Source database requirements
    • Location flexibility: self-managed PostgreSQL, AWS RDS, GCP Cloud SQL, Azure, etc.—no source adjustments needed.
    • No ZFS or Docker requirements for source databases
  • Data provisioning & retrieval
    • Physical (pg_basebackup, WAL-G, pgBackRest) and logical (dump/restore) provisioning
    • Partial data retrieval in logical mode (specific databases/tables)
    • Database renaming during snapshot creation (databaseRename option)
    • Continuous update in physical mode
    • Periodic full refresh in logical mode without downtime
  • Recovery & management
    • Fast Point in Time Recovery (PITR) for physical mode
    • Auto-deletion of unused clones
    • Snapshot retention policies in DBLab configuration
  • Clones
    • "Deletion protection" for preventing clone deletion
    • Persistent clones withstand DBLab restarts
    • "Reset" command for data version switching
    • Resource quotas: CPU, RAM
  • Monitoring & security
    • /healthz API endpoint (no auth), extended /status endpoint (API docs)
    • Prometheus metrics endpoint (/metrics) for monitoring
    • Netdata module for insights

How to contribute

Support us on GitHub/GitLab

The simplest way to show your support is by giving us a star on GitHub or GitLab! ⭐

Add a star

Spread the word

  • Tweet about DBLab and mention @Database_Lab.
  • Share a link to this repository on your favorite social media platform.

Share your experience

If DBLab has been a vital tool for you, tell the world about your journey. Use the logo from the ./assets folder for a visual touch. Whether it's in documents, presentations, applications, or on your website, let everyone know you trust and use DBLab.

HTML snippet for lighter backgrounds:

<a href="http://databaselab.io">
  <img width="400" src="https://postgres.ai/assets/powered-by-dle-for-light-background.svg" />
</a>

For darker backgrounds:

<a href="http://databaselab.io">
  <img width="400" src="https://postgres.ai/assets/powered-by-dle-for-dark-background.svg" />
</a>

Propose an idea or report a bug

For proposals, bug reports, and participation in development, see our Contributing Guide.

Reference guides

How-to guides

You can find more in the "How-to guides" section of the documentation.

Miscellaneous

License

The DBLab source code is licensed under the OSI-approved open source license Apache 2.0.

Reach out to the Postgres.ai team if you want a trial or commercial license that does not contain the GPL clauses: Contact page.

Community & Support

Contributor Covenant

Many thanks to our amazing contributors!

<a href = "https://github.com/postgres-ai/d

Extension points exported contracts — how you extend this code

Runner (Interface)
Runner runs commands. [17 implementers]
engine/internal/provision/runners/runners.go
Accessor (Interface)
Accessor is an interface for getting and setting values from a json / yaml / anything else [3 implementers]
engine/pkg/util/projection/types.go
ImportMetaEnv (Interface)
(no doc)
ui/packages/ce/src/vite-env.d.ts
JobRunner (Interface)
JobRunner performs a job. [5 implementers]
engine/internal/retrieval/components/components.go
ImportMeta (Interface)
(no doc)
ui/packages/ce/src/vite-env.d.ts
Cloner (Interface)
Cloner describes methods of clone management. [4 implementers]
engine/internal/provision/pool/manager.go
ProcessEnv (Interface)
(no doc)
ui/packages/ce/src/vite-env.d.ts
StateReporter (Interface)
StateReporter describes methods of state reporting. [4 implementers]
engine/internal/provision/pool/manager.go

Core symbols most depended-on inside this repo

r
called by 2549
engine/api/swagger-ui/swagger-ui-bundle.js
r
called by 2549
engine/api/swagger-ui/swagger-ui-es-bundle.js
r
called by 1130
engine/api/swagger-ui/swagger-ui-standalone-preset.js
q
called by 797
engine/api/swagger-ui/swagger-ui.js
r
called by 664
engine/api/swagger-ui/swagger-ui-es-bundle-core.js
get
called by 534
engine/api/swagger-ui/swagger-ui-bundle.js
get
called by 534
engine/api/swagger-ui/swagger-ui-es-bundle.js
r
called by 512
engine/api/swagger-ui/swagger-ui.js

Shape

Function 2,775
Method 1,999
Class 742
Struct 319
Interface 42
TypeAlias 17
FuncType 7

Languages

TypeScript58%
Go42%

Modules by API surface

engine/api/swagger-ui/swagger-ui-es-bundle.js874 symbols
engine/api/swagger-ui/swagger-ui-bundle.js874 symbols
engine/api/swagger-ui/swagger-ui.js495 symbols
engine/api/swagger-ui/swagger-ui-es-bundle-core.js484 symbols
engine/api/swagger-ui/swagger-ui-standalone-preset.js269 symbols
engine/internal/provision/thinclones/zfs/zfs.go61 symbols
engine/internal/provision/pool/pool_manager_test.go53 symbols
engine/internal/provision/mode_local_test.go50 symbols
engine/internal/provision/pool/manager.go49 symbols
engine/internal/retrieval/engine/postgres/snapshot/physical.go47 symbols
engine/internal/cloning/base.go44 symbols
engine/internal/provision/thinclones/lvm/lvmanager.go43 symbols

Dependencies from manifests, versioned

dario.cat/mergov1.0.2 · 1×
github.com/AlekSi/pointerv1.2.0 · 1×
github.com/Azure/go-ansitermv0.0.0-2025010203350 · 1×
github.com/Microsoft/go-winiov0.6.2 · 1×
github.com/ahmetalpbalkan/dlogv0.0.0-2017010520534 · 1×
github.com/araddon/dateparsev0.0.0-2021042916200 · 1×
github.com/aws/aws-sdk-gov1.55.8 · 1×
github.com/aws/aws-sdk-go-v2v1.41.5 · 1×
github.com/aws/aws-sdk-go-v2/configv1.32.14 · 1×
github.com/aws/aws-sdk-go-v2/credentialsv1.19.14 · 1×
github.com/aws/aws-sdk-go-v2/feature/ec2/imdsv1.18.21 · 1×
github.com/aws/aws-sdk-go-v2/internal/configsourcesv1.4.21 · 1×

Datastores touched

DBNAMEDatabase · 1 repos

For agents

$ claude mcp add database-lab-engine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact