edwh-devdb-plugin


Nameedwh-devdb-plugin JSON
Version 0.5.3 PyPI version JSON
download
home_pageNone
Summaryedwh plugin for quick database snapshot creation and recovery
upload_time2025-07-14 10:29:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords edwh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
uv pip install -e .[dev]
```

### Production Installation

For production use, you can install the plugin using:

```bash
uvenv install edwh[devdb]
```

Alternatively, you can add the plugin directly with:

```bash
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:

```bash
ew devdb.snapshot
```

You can exclude specific tables using optional parameters:

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

#### List Snapshots

To list all snapshots in reverse chronological order:

```bash
ew devdb.list
```

#### Rename a Snapshot

To rename the most recent snapshot:

```bash
ew devdb.rename <new_name>
```

#### Push a Snapshot

To push the local snapshot to a remote server:

```bash
ew devdb.push
```

#### Pop a Snapshot

To download and prepare a snapshot from a given URL:

```bash
ew devdb.pop <url>
```

#### Recover a Snapshot

To recover the database from a snapshot:

```bash
ew devdb.recover
```

This assumes an empty database. An easier alternative is:

#### Reset the Database

To reset your database to the latest state:

```bash
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](https://github.com/educationwarehouse/edwh-devdb-plugin).

## License

This project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "edwh-devdb-plugin",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "edwh",
    "author": null,
    "author_email": "Remco Boerma <remco.b@educationwarehouse.nl>, Robin van der Noord <robin.vdn@educationwarehouse.nl>",
    "download_url": "https://files.pythonhosted.org/packages/fc/ab/a358906b57fd49d73fae602b20d3c8d16cc6a428ff298aeb6be317520c7f/edwh_devdb_plugin-0.5.3.tar.gz",
    "platform": null,
    "description": "# EDWH Development Database (`devdb`) Plugin\n\n## Overview\n\nThe EDWH Development Database Plugin provides a comprehensive set of tools for managing snapshots of the development\ndatabase. This plugin allows developers to create, push, pop, recover, and list database snapshots efficiently.\n\n## Features\n\n- **Snapshot Management**: Create and manage snapshots of the development database.\n- **Selective Exclusion**: Optionally exclude specific tables during snapshot creation.\n- **Remote Operations**: Push and pop snapshots to/from a remote server.\n- **Database Recovery**: Recover the database from previously created snapshots.\n- **Environment Setup**: Easy setup of environment variables for PostgreSQL connections.\n\n## Requirements\n\n- Python 3.12+\n- Docker Compose\n- PostgreSQL\n- EDWH environment variables configured (usually via `edwh setup`)\n\n## Installation\n\n### Development Installation\n\nTo install the plugin in development mode, run:\n\n```bash\nuv pip install -e .[dev]\n```\n\n### Production Installation\n\nFor production use, you can install the plugin using:\n\n```bash\nuvenv install edwh[devdb]\n```\n\nAlternatively, you can add the plugin directly with:\n\n```bash\nedwh plugin.add devdb\n```\n\n## Usage\n\n### Environment Variables\n\nEnsure the following environment variables are set:\n\n- `POSTGRES_USERNAME`: Username for PostgreSQL (default: `postgres`)\n- `POSTGRES_PASSWORD`: Password for PostgreSQL (default: `password`)\n- `PGPOOL_PORT`: Port for pgpool (default: `5432`)\n- `POSTGRES_DATABASE`: Name of the PostgreSQL database (default: `backend`)\n\nThen you can run `edwh setup` and the other required variables can be infered.\n\n### Commands\n\n#### Create a Snapshot\n\nTo create a snapshot of the development database:\n\n```bash\new devdb.snapshot\n```\n\nYou can exclude specific tables using optional parameters:\n\n```bash\new devdb.snapshot --without_api_activity False --without_applog False\n```\n\n#### List Snapshots\n\nTo list all snapshots in reverse chronological order:\n\n```bash\new devdb.list\n```\n\n#### Rename a Snapshot\n\nTo rename the most recent snapshot:\n\n```bash\new devdb.rename <new_name>\n```\n\n#### Push a Snapshot\n\nTo push the local snapshot to a remote server:\n\n```bash\new devdb.push\n```\n\n#### Pop a Snapshot\n\nTo download and prepare a snapshot from a given URL:\n\n```bash\new devdb.pop <url>\n```\n\n#### Recover a Snapshot\n\nTo recover the database from a snapshot:\n\n```bash\new devdb.recover\n```\n\nThis assumes an empty database. An easier alternative is:\n\n#### Reset the Database\n\nTo reset your database to the latest state:\n\n```bash\new devdb.reset\n```\n\n## Notes\n\n- Be cautious when using the `reset` command as it will clear your PostgreSQL database and remove all existing data.\n\n## Repository\n\nThe source code is available at [GitHub](https://github.com/educationwarehouse/edwh-devdb-plugin).\n\n## License\n\nThis project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "edwh plugin for quick database snapshot creation and recovery",
    "version": "0.5.3",
    "project_urls": {
        "Documentation": "https://github.com/educationwarehouse/edwh-devdb-plugin#readme",
        "Issues": "https://github.com/educationwarehouse/edwh-devdb-plugin/issues",
        "Source": "https://github.com/educationwarehouse/edwh-devdb-plugin"
    },
    "split_keywords": [
        "edwh"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3fcef91c0069a1df6fe8b6aca2bb73cff563a9aedd0b901b23263044939a4663",
                "md5": "bf7d9160b34d6d8aa9ddd38bb11439e4",
                "sha256": "b0d3ce6491a7bcbd33478470e3404d4cdf499b25c98b6f7171116e05abb99c4d"
            },
            "downloads": -1,
            "filename": "edwh_devdb_plugin-0.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bf7d9160b34d6d8aa9ddd38bb11439e4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 9319,
            "upload_time": "2025-07-14T10:29:04",
            "upload_time_iso_8601": "2025-07-14T10:29:04.173109Z",
            "url": "https://files.pythonhosted.org/packages/3f/ce/f91c0069a1df6fe8b6aca2bb73cff563a9aedd0b901b23263044939a4663/edwh_devdb_plugin-0.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fcaba358906b57fd49d73fae602b20d3c8d16cc6a428ff298aeb6be317520c7f",
                "md5": "49d78f9260007e7c5fdb98829905ed04",
                "sha256": "682db483b71d77a7c07dbb51b535cb0c85814937eb992276f363e10e126ca15e"
            },
            "downloads": -1,
            "filename": "edwh_devdb_plugin-0.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "49d78f9260007e7c5fdb98829905ed04",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 10292,
            "upload_time": "2025-07-14T10:29:05",
            "upload_time_iso_8601": "2025-07-14T10:29:05.427050Z",
            "url": "https://files.pythonhosted.org/packages/fc/ab/a358906b57fd49d73fae602b20d3c8d16cc6a428ff298aeb6be317520c7f/edwh_devdb_plugin-0.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-14 10:29:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "educationwarehouse",
    "github_project": "edwh-devdb-plugin#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "edwh-devdb-plugin"
}
        
Elapsed time: 1.11854s