Meta-commands handler for Postgres Database.
Meta-commands for Postgres
This package provides an API to execute meta-commands (AKA “special”, or “backslash commands”) on PostgreSQL.
This is a python package. It can be installed with:
$ pip install pgspecial
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 from psycopg2.extensions import cursor
Then you will create and use an instance of PGSpecial:
pgspecial = PGSpecial() for result in pgspecial.execute(cur: cursor, 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'))
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.
Please feel free to file an issue if you need help.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pgspecial-1.13.0-py3-none-any.whl (35.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size pgspecial-1.13.0.tar.gz (47.9 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for pgspecial-1.13.0-py3-none-any.whl