Meta-commands handler for Postgres Database.
Project description
Meta-commands for Postgres
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 to me if you need help. My email: amjith.r@gmail.com, Twitter: @amjithr
Projects using it:
This module is being used by pgcli: A REPL for Postgres.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pgspecial-1.8.0.tar.gz
.
File metadata
- Download URL: pgspecial-1.8.0.tar.gz
- Upload date:
- Size: 41.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89f524909e97554bb3eeceb186a834e86cb71e34afef3a95fe645049ead894b7 |
|
MD5 | 0d1ef54c1f950d5c211f31bdf74398dc |
|
BLAKE2b-256 | bd61b35b4622813d6659653290bf6c001b22dc0c5d0b88c0948db47d15d1c42d |