Skip to main content

EDWH Development Database (devdb) Plugin

Overview

The EDWH Development Database Plugin provides a comprehensive set of tools for managing snapshots of the development database. This plugin allows developers to create, push, pop, recover, and list database snapshots efficiently.

Features

  • Snapshot Management: Create and manage snapshots of the development database.
  • Selective Exclusion: Optionally exclude specific tables during snapshot creation.
  • Remote Operations: Push and pop snapshots to/from a remote server.
  • Database Recovery: Recover the database from previously created snapshots.
  • Environment Setup: Easy setup of environment variables for PostgreSQL connections.

Requirements

  • Python 3.12+
  • Docker Compose
  • PostgreSQL
  • EDWH environment variables configured (usually via edwh setup)

Installation

Development Installation

To install the plugin in development mode, run:

uv pip install -e .[dev]

Production Installation

For production use, you can install the plugin using:

uvenv install edwh[devdb]

Alternatively, you can add the plugin directly with:

edwh plugin.add devdb

Usage

Environment Variables

Ensure the following environment variables are set:

  • POSTGRES_USERNAME: Username for PostgreSQL (default: postgres)
  • POSTGRES_PASSWORD: Password for PostgreSQL (default: password)
  • PGPOOL_PORT: Port for pgpool (default: 5432)
  • POSTGRES_DATABASE: Name of the PostgreSQL database (default: backend)

Then you can run edwh setup and the other required variables can be infered.

Commands

Create a Snapshot

To create a snapshot of the development database:

ew devdb.snapshot

You can exclude specific tables using optional parameters:

ew devdb.snapshot --without_api_activity False --without_applog False

List Snapshots

To list all snapshots in reverse chronological order:

ew devdb.list

Rename a Snapshot

To rename the most recent snapshot:

ew devdb.rename <new_name>

Push a Snapshot

To push the local snapshot to a remote server:

ew devdb.push

Pop a Snapshot

To download and prepare a snapshot from a given URL:

ew devdb.pop <url>

Recover a Snapshot

To recover the database from a snapshot:

ew devdb.recover

This assumes an empty database. An easier alternative is:

Reset the Database

To reset your database to the latest state:

ew devdb.reset

Notes

  • Be cautious when using the reset command as it will clear your PostgreSQL database and remove all existing data.

Repository

The source code is available at GitHub.

License

This project is licensed under the MIT License.

Metadata

Release files for edwh-devdb-plugin 0.7.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edwh-devdb-plugin 0.7.4
File Size Uploaded
edwh_devdb_plugin-0.7.4.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for edwh-devdb-plugin 0.7.4
File Interpreter ABI Platform
edwh_devdb_plugin-0.7.4-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / edwh_devdb_plugin-0.7.4.tar.gz

Download URL edwh_devdb_plugin-0.7.4.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
558438e4e5c4a98942a476805583e2c7315e5082437475c609464dd0756bf87d
BLAKE2b-256 checksum
How to use checksums
839701d6af39b9e6955d9544dd67107375d36cdf18b9c60b52901fe99b3e58d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Release files / edwh_devdb_plugin-0.7.4-py3-none-any.whl

Download URL edwh_devdb_plugin-0.7.4-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c2139250f8cb8ef13b1c25de27cbcfe92164ad102c878239681d20148b0748d
BLAKE2b-256 checksum
How to use checksums
73a26f4461d39f6a9d830019b7466223312ff590e0fb813d98d192430aacb42f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.4

Release history Release notifications | RSS feed

This release

0.7.4 This release

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page