Skip to main content

Meta-commands handler for Postgres Database.

Project description

Meta-commands for Postgres

BuildStatus 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 reach out if you need help.

mailing list: https://groups.google.com/forum/#!forum/pgcli

Projects using it:

This library is used by the following projects:

pgcli: A REPL for Postgres.

ipython-sql: %%sql magic for IPython

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

Uploaded Source

File details

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

File metadata

  • Download URL: pgspecial-1.11.0.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pgspecial-1.11.0.tar.gz
Algorithm Hash digest
SHA256 a4511ba8b65b1f68eb2f8242f052b431534aa4b343788d17aa58cdd864d18d7c
MD5 6406b710f9b64d8b63e542108df238b2
BLAKE2b-256 0f07847815d9effa367ac045a8d8b2ef62058a348f3dea41b98f98d1a33c71f9

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