Skip to main content

This package is based on py-postgresql upgrades to work with openGauss.

Repo: https://gitee.com/opengauss/openGauss-connector-python-pyog Adapted from: http://github.com/python-postgres/fe v1.3.0

py-opengauss is a set of Python modules providing interfaces to various parts of openGauss. Primarily, it provides a pure-Python driver with some C optimizations for querying a openGauss database.

https://gitee.com/opengauss/openGauss-connector-python-pyog

Features:

  • Prepared Statement driven interfaces.

  • Cluster tools for creating and controlling a cluster.

  • Support for most PostgreSQL types: composites, arrays, numeric, lots more.

  • COPY support.

  • Multiple ip connect support

Sample PG-API Code:

>>> import py_opengauss
>>> db = py_opengauss.open('pq://user:password@host:port,host:port/database')
>>> db.execute("CREATE TABLE emp (emp_first_name text, emp_last_name text, emp_salary numeric)")
>>> make_emp = db.prepare("INSERT INTO emp VALUES ($1, $2, $3)")
>>> make_emp("John", "Doe", "75,322")
>>> with db.xact():
...  make_emp("Jane", "Doe", "75,322")
...  make_emp("Edward", "Johnson", "82,744")
...

There is a DB-API 2.0 module as well:

py_opengauss.driver.dbapi20

However, PG-API is recommended as it provides greater utility.

Once installed, try out the pg_python console script:

$ python3 -m py_opengauss.bin.pg_python -h localhost -p port -U theuser -d database_name

If a successful connection is made to the remote host, it will provide a Python console with the database connection bound to the db name.

Metadata

Release files for py-opengauss 1.3.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-opengauss 1.3.11
File Size Uploaded
py_opengauss-1.3.11.tar.gz 275.9 kB Details

Release files / py_opengauss-1.3.11.tar.gz

Download URL py_opengauss-1.3.11.tar.gz
Size 275.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3cc8c48c902a02b1b3886589d31c984651565ac671b7b92be2b51c23ffb81a64
BLAKE2b-256 checksum
How to use checksums
bd3db367fd27f8bf69e725c02f67cfb66f838d6ba4044e87b2c86754660df67c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.3.11 This release

1 release file

1.3.10

1 release file

1.3.9

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2

1 release file

1.3.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page