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
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'))

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

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

Uploaded Source

Built Distribution

pgspecial-1.12.1-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pgspecial-1.12.1.tar.gz
  • Upload date:
  • Size: 46.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pgspecial-1.12.1.tar.gz
Algorithm Hash digest
SHA256 b68feb0005f57861573d3fbb82c5c777950decfbb2d1624af57aec825db02c02
MD5 5fc0fabd3faa95e60bc81af0f1a78735
BLAKE2b-256 a5334e34d3b0bbf1a8dfd8d1854bcc9a8e4d334f181d1487353e8fbb499c0bf2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pgspecial-1.12.1-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pgspecial-1.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1b7a58dde1e2fb060eb876f2033fa3b140137e4c18e5355dff7f6d3691d8065
MD5 1e087287d2a41dccc095cd0b6af331b0
BLAKE2b-256 56c07007a2669c218a5d4fdef067273d8d06f771367f1f10bbaa6ec996fa0fbe

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