Skip to main content

PostgreSQL extensions management for DBWarden

Project description

dbwarden-pgsql-extensions

PostgreSQL extension management for DBWarden.

Declare extensions in database_config(pg_extensions=[...]) and this plugin emits CREATE EXTENSION / DROP EXTENSION in the migration preamble, before any table that depends on them.

Object type

Object type Manages
pg_extension CREATE EXTENSION IF NOT EXISTS / DROP EXTENSION IF EXISTS

The handler runs in RunPhase.PREAMBLE, anchored after PREAMBLE and before BEFORE_TABLES, so extension-provided types are available by the time tables are created. Both directions are idempotent and reversible.

Usage

from dbwarden import database_config

database_config(
    database_name="primary",
    database_type="postgresql",
    database_url_sync="postgresql://...",
    pg_extensions=["postgis", "hstore"],
)

Installation

dbwarden plugin add dbwarden-pgsql-extensions

Trust tier

This is an official DBWarden plugin. Its distribution name is classified before any of its code is imported, and dbwarden plugin add verifies the PyPI Trusted-Publishing attestation (PEP 740) against dbwarden-org/dbwarden-pgsql-extensions before installing. It loads automatically once installed, with no dbwarden plugin trust step.

Development

uv venv && uv pip install -e . -e ../dbwarden pytest
pytest -q

The tests/test_conformance.py suite runs DBWarden's shared conformance harness (dbwarden.plugin_conformance): entry point resolution, no import-time side effects, hook signatures, public-API-only imports, and idempotent setup().

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbwarden_pgsql_extensions-0.1.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbwarden_pgsql_extensions-0.1.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file dbwarden_pgsql_extensions-0.1.1.tar.gz.

File metadata

File hashes

Hashes for dbwarden_pgsql_extensions-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2eede9d14f39dc2c5a00c92eed59a149b30347000fbc9540d1793c846c311957
MD5 5fe83c5166a7cdbd92888b5f93ca7a0f
BLAKE2b-256 7d083c54c5053e1b16582dedc650cbea02187ee75c1ca64679f4ff7aa961b998

See more details on using hashes here.

File details

Details for the file dbwarden_pgsql_extensions-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dbwarden_pgsql_extensions-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ce9bfb987e7e0b7538e68a09b63802e40d20d4f19441dc978755d0e6bfc3760
MD5 8779958afab6b66ccda44c46876793a8
BLAKE2b-256 f74d0f00c9a274884147de4630f92e90f77b37da93493a1e8d984811dcda4297

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page