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.1.1.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: pgspecial-2.1.1.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for pgspecial-2.1.1.tar.gz
Algorithm Hash digest
SHA256 a38239cd961fac33ce6da35c466d758acb6f942901598d7df74e5b82fe6f5636
MD5 1f0c67f1444293f059609172ebbb729c
BLAKE2b-256 2eb852f0d19d80872df8ed2bbfc4569196e30d455d3b5f91659a6bf5c0d8e57e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pgspecial-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for pgspecial-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be841a21b0754bf8f277608c23577818798671f7bf3f9dafa9ec9d745da3c89d
MD5 e950d2511def793fc3d2f0c2afad1aae
BLAKE2b-256 9fc6bcef71783f4aa658dcda7fac96dcd453083de4c421cec93100946423e54e

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