Skip to main content

Opengauss driver and tools library.

Project description

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

Forked Repo: http://github.com/vimiix/py-opengauss

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

http://github.com/python-postgres/fe

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.

Sample PG-API Code:

>>> import postgresql
>>> db = postgresql.open('pq://user:password@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:

postgresql.driver.dbapi20

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

Once installed, try out the pg_python console script:

$ python3 -m postgresql.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-opengauss-1.3.1.tar.gz (210.5 kB view details)

Uploaded Source

File details

Details for the file py-opengauss-1.3.1.tar.gz.

File metadata

  • Download URL: py-opengauss-1.3.1.tar.gz
  • Upload date:
  • Size: 210.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for py-opengauss-1.3.1.tar.gz
Algorithm Hash digest
SHA256 ab005b0780e63c60a1cb09f23cbe12c61daaeb3087979b9f749c1c1a7b4df93f
MD5 6a33a48048af1fb1d682c86342d7882f
BLAKE2b-256 cb849447a7eaa0508afdee3b1768aef992780254e1a09d41923c7cd6aef0d9f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page