1- asyncpg -- A fast PostgreSQL Database Client Library for Python/asyncio
2- =======================================================================
1+ asyncpg-gaussdb -- A fast GaussDB/openGauss Database Client Library for Python/asyncio
2+ =====================================================================================
33
44.. image :: https://github.com/MagicStack/asyncpg/workflows/Tests/badge.svg
55 :target: https://github.com/MagicStack/asyncpg/actions?query=workflow%3ATests+branch%3Amaster
66 :alt: GitHub Actions status
77.. image :: https://img.shields.io/pypi/v/asyncpg.svg
88 :target: https://pypi.python.org/pypi/asyncpg
99
10- **asyncpg ** is a database interface library designed specifically for
11- PostgreSQL and Python/asyncio. asyncpg is an efficient, clean implementation
12- of PostgreSQL server binary protocol for use with Python's ``asyncio ``
13- framework. You can read more about asyncpg in an introductory
14- `blog post <http://magic.io/blog/asyncpg-1m-rows-from-postgres-to-python/ >`_.
10+ **asyncpg-gaussdb ** is a database interface library designed specifically for
11+ GaussDB and openGauss databases with Python/asyncio. This fork of asyncpg is
12+ optimized for GaussDB/openGauss compatibility, including native SHA256
13+ authentication support and enhanced features for enterprise database environments.
1514
16- asyncpg requires Python 3.8 or later and is supported for PostgreSQL
17- versions 9.5 to 17. Other PostgreSQL versions or other databases
18- implementing the PostgreSQL protocol *may * work, but are not being
19- actively tested.
15+ asyncpg-gaussdb requires Python 3.8 or later and is specifically designed for
16+ GaussDB and openGauss databases. It includes compatibility fixes and
17+ optimizations for openGauss-specific features and enterprise database requirements.
18+
19+ **Key Features for GaussDB/openGauss: **
20+ * Native SHA256 authentication support
21+ * Optimized for openGauss protocol compatibility
22+ * Enhanced error handling for enterprise database features
23+ * Support for GaussDB-specific data types and functions
24+ * Comprehensive test suite adapted for openGauss
2025
2126
2227Documentation
@@ -29,7 +34,8 @@ The project documentation can be found
2934Performance
3035-----------
3136
32- In our testing asyncpg is, on average, **5x ** faster than psycopg3.
37+ asyncpg-gaussdb maintains the high performance characteristics of the original
38+ asyncpg library while being optimized for GaussDB/openGauss environments.
3339
3440.. image :: https://raw.githubusercontent.com/MagicStack/asyncpg/master/performance.png?fddca40ab0
3541 :target: https://gistpreview.github.io/?0ed296e93523831ea0918d42dd1258c2
@@ -42,31 +48,31 @@ in June 2023 (click on the chart to see full details).
4248Features
4349--------
4450
45- asyncpg implements PostgreSQL server protocol natively and exposes its
46- features directly, as opposed to hiding them behind a generic facade
47- like DB-API.
48-
49- This enables asyncpg to have easy-to-use support for:
51+ asyncpg-gaussdb implements the GaussDB/openGauss server protocol natively and
52+ exposes its features directly, optimized for enterprise database environments:
5053
51- * **prepared statements **
52- * **scrollable cursors **
53- * **partial iteration ** on query results
54+ * **SHA256 authentication ** - Native support for GaussDB/openGauss authentication
55+ * **prepared statements ** - Optimized for openGauss query execution
56+ * **scrollable cursors ** - Full cursor support for large result sets
57+ * **partial iteration ** on query results - Memory-efficient data processing
5458* automatic encoding and decoding of composite types, arrays,
5559 and any combination of those
5660* straightforward support for custom data types
61+ * **openGauss compatibility ** - Comprehensive test suite and error handling
62+ * **Enterprise features ** - Optimized for production GaussDB environments
5763
5864
5965Installation
6066------------
6167
62- asyncpg is available on PyPI. When not using GSSAPI/SSPI authentication it
63- has no dependencies. Use pip to install::
68+ asyncpg-gaussdb is available on PyPI. When not using GSSAPI/SSPI authentication it
69+ has no dependencies. Use pip to install::
6470
65- $ pip install asyncpg
71+ $ pip install async-gaussdb
6672
6773If you need GSSAPI/SSPI authentication, use::
6874
69- $ pip install 'asyncpg [gssauth]'
75+ $ pip install 'async-gaussdb [gssauth]'
7076
7177For more details, please `see the documentation
7278<https://magicstack.github.io/asyncpg/current/installation.html> `_.
@@ -81,8 +87,47 @@ Basic Usage
8187 import asyncpg
8288
8389 async def run ():
84- conn = await asyncpg.connect(user = ' user' , password = ' password' ,
85- database = ' database' , host = ' 127.0.0.1' )
90+ # Connect to GaussDB/openGauss
91+ conn = await asyncpg.connect(
92+ user = ' omm' ,
93+ password = ' your_password' ,
94+ database = ' postgres' ,
95+ host = ' 127.0.0.1' ,
96+ port = 5432
97+ )
98+
99+ # Execute queries with full GaussDB support
100+ values = await conn.fetch(
101+ ' SELECT * FROM mytable WHERE id = $1' ,
102+ 10 ,
103+ )
104+ await conn.close()
105+
106+ asyncio.run(run())
107+
108+
109+ GaussDB/openGauss Specific Features
110+ ----------------------------------
111+
112+ This library includes enhanced support for GaussDB and openGauss databases:
113+
114+ .. code-block :: python
115+
116+ import asyncio
117+ import asyncpg
118+
119+ async def run ():
120+ # Connect with SHA256 authentication (GaussDB/openGauss specific)
121+ conn = await asyncpg.connect(
122+ user = ' omm' ,
123+ password = ' your_password' ,
124+ database = ' postgres' ,
125+ host = ' 127.0.0.1' ,
126+ port = 5432
127+ )
128+
129+ # Use GaussDB-specific features
130+ # The library automatically handles openGauss protocol differences
86131 values = await conn.fetch(
87132 ' SELECT * FROM mytable WHERE id = $1' ,
88133 10 ,
@@ -92,7 +137,21 @@ Basic Usage
92137 asyncio.run(run())
93138
94139
140+ Development with Docker
141+ ----------------------
142+
143+ A Dockerfile is provided for development with openGauss:
144+
145+ .. code-block :: bash
146+
147+ # Build the development image
148+ docker build -t asyncpg-gaussdb-dev .
149+
150+ # Run the container
151+ docker run -it asyncpg-gaussdb-dev
152+
153+
95154 License
96155-------
97156
98- asyncpg is developed and distributed under the Apache 2.0 license.
157+ asyncpg-gaussdb is developed and distributed under the Apache 2.0 license.
0 commit comments