Skip to main content

Python tools for DBAs with deadlines!

Project description

pydba - a handy Python library for common database admin operations.

API Usage

Basic imports and class constructor usage.

>>> from pydba import PostgresDB
>>> db = PostgresDB()
>>> db.available()
True
>>> db.names()
['postgres']

Database creation and deletion.

>>> db.create('foo')
>>> db.names()
['postgres', 'foo']
>>> db.rename('foo', 'bar')
>>> db.names()
['postgres', 'bar']

Database backup and restore.

>>> db.dump('bar', 'bar.backup')
>>> db.drop('bar')
>>> db.names()
['postgres']
>>> db.restore('bar', 'bar.backup')
>>> db.names()
['postgres', 'bar']

Querying and removing shutting down database connections.

>>> db.connections('postgres')
[{'datname': 'postgres', 'state': 'idle', 'pid': 8937, 'psql', 'query': '', 'usename': 'drkjam', ...}]
>>> db.kill_connections('postgres')
>>> db.connections('postgres')
[]

Download files

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

Source Distributions

pydba-1.0.0.zip (7.6 kB view details)

Uploaded Source

pydba-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

pydba-1.0.0-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pydba-1.0.0.zip.

File metadata

  • Download URL: pydba-1.0.0.zip
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydba-1.0.0.zip
Algorithm Hash digest
SHA256 363554997283271a0acec823da10eada4984b708479a30aea9f61d168994a465
MD5 9f6e94d90b757a223f17e5cd25124020
BLAKE2b-256 b1e33574417dd51eb003509d3700f3a32d87dccde8277cd1cec06e4e3a6cd485

See more details on using hashes here.

File details

Details for the file pydba-1.0.0.tar.gz.

File metadata

  • Download URL: pydba-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydba-1.0.0.tar.gz
Algorithm Hash digest
SHA256 588544b1865fa5cac2d6f18c6922e170cb4dc6c385dd24af72879cb2a4dec178
MD5 2776daff7a6bb77edb34c67b00a303e2
BLAKE2b-256 898f810dcca53a10672ca2a9ec29414e33d65960b0b4adc050df512b7badabf4

See more details on using hashes here.

File details

Details for the file pydba-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pydba-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c472015fbe7dd59e302b85768a77e69d8e906e7b25a2266e22cc986987180197
MD5 60541d3e01fad615da339a7fa1644e87
BLAKE2b-256 d512c07ad6e574ff91a88380963336f48aeff7664c7b218496b98a6c43b17ce2

See more details on using hashes here.

Supported by

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