Metadata-Version: 2.1
Name: py-opengauss
Version: 1.3.10
Summary: Opengauss driver and tools library.
Home-page: https://gitee.com/opengauss/openGauss-connector-python-pyog
Author: James William Pye
Author-email: james.pye@gmail.com
Maintainer: Vimiix
Maintainer-email: i@vimiix.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Attribution Assurance License
Classifier: License :: OSI Approved :: Python Software Foundation License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Requires-Python: >=3.3
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS


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

.. warning::
	In v1.3, `py_opengauss.driver.dbapi20.connect` will now raise `ClientCannotConnectError` directly.
	Exception traps around connect should still function, but the `__context__` attribute
	on the error instance will be `None` in the usual failure case as it is no longer
	incorrectly chained. Trapping `ClientCannotConnectError` ahead of `Error` should
	allow both cases to co-exist in the event that data is being extracted from
	the `ClientCannotConnectError`.

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.


