Opengauss driver and tools library.
Project description
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.
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 py-opengauss-1.3.10.tar.gz
.
File metadata
- Download URL: py-opengauss-1.3.10.tar.gz
- Upload date:
- Size: 275.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ae166f1c3191717056799429e2a15914328b7c4d772485b6f827eb7ceb090b7 |
|
MD5 | 09090214122a648c68599e13b571a02c |
|
BLAKE2b-256 | 3ed7c72126558be5704eb9ebbcb969159caa486849148dd2ae3f66e2b445c4c3 |