Skip to main content

Meta-commands handler for Postgres Database.

Project description

Meta-commands for Postgres

Build Status Latest Version

This package provides an API to execute meta-commands (AKA “special”, or “backslash commands”) on PostgreSQL.

Quick Start

This is a python package. It can be installed with:

$ pip install pgspecial

Usage

Once this library is included into your project, you will most likely use the following imports:

from pgspecial.main import PGSpecial
from pgspecial.namedqueries import NamedQueries

Then you will create and use an instance of PGSpecial:

pgspecial = PGSpecial()
for result in pgspecial.execute(cur, sql):
    # Do something

If you want to import named queries from an existing config file, it is convenient to initialize and keep around the class variable in NamedQueries:

from configobj import ConfigObj

NamedQueries.instance = NamedQueries.from_config(
    ConfigObj('~/.config_file_name'))

Contributions:

If you’re interested in contributing to this project, first of all I would like to extend my heartfelt gratitude. I’ve written a small doc to describe how to get this running in a development setup.

https://github.com/dbcli/pgspecial/blob/master/DEVELOP.rst

Please feel free to file an issue if you need help.

Projects using it:

This library is used by the following projects:

pgcli: A REPL for Postgres.

ipython-sql: %%sql magic for IPython

OmniDB: An web tool for database management

If you find this module useful and include it in your project, I’ll be happy to know about it and list it here.

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

pgspecial-2.2.1.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

pgspecial-2.2.1-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file pgspecial-2.2.1.tar.gz.

File metadata

  • Download URL: pgspecial-2.2.1.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pgspecial-2.2.1.tar.gz
Algorithm Hash digest
SHA256 da6c7fcc7bef7bb0132dc2046f74ec6513b1fe6f0c80e5528d630d14b7c4849d
MD5 34fffa745a77a24e420373c82506f94b
BLAKE2b-256 12b3f342d6a9ec37fddff8c30b4f6eb5e83990f5d33135cecf381d3f7a0c1c9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgspecial-2.2.1.tar.gz:

Publisher: publish.yml on dbcli/pgspecial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pgspecial-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: pgspecial-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pgspecial-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08d86faaf360603a25850e259efc083bded4c1e8ffd2cfe2950b8ceefdfb4c9c
MD5 a40b682a9cf26df449d45c762d13336e
BLAKE2b-256 849f151c714d38f893d31688c9454646a078a8d884d9d8d39e3b281178f4d8b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgspecial-2.2.1-py3-none-any.whl:

Publisher: publish.yml on dbcli/pgspecial

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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