forked from opengaussexamples/examples
chore: 删除 django-opengauss 相关的 egg-info 文件 和 pycache 文件
This commit is contained in:
parent
daebdcb819
commit
e1d22f1cf3
|
|
@ -1,151 +0,0 @@
|
|||
Metadata-Version: 2.4
|
||||
Name: django-opengauss
|
||||
Version: 1.0.2
|
||||
Summary: Django database backend for openGauss.
|
||||
Author: openGauss Community
|
||||
License: MIT License
|
||||
|
||||
Copyright (c) 2024 openGauss Community
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
Project-URL: Homepage, https://gitee.com/opengauss
|
||||
Project-URL: Source, https://gitee.com/opengauss
|
||||
Keywords: django,opengauss,database,backend
|
||||
Classifier: Framework :: Django
|
||||
Classifier: Framework :: Django :: 3.2
|
||||
Classifier: Framework :: Django :: 4.0
|
||||
Classifier: Framework :: Django :: 4.1
|
||||
Classifier: Framework :: Django :: 4.2
|
||||
Classifier: Framework :: Django :: 5.0
|
||||
Classifier: Programming Language :: Python
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Topic :: Database
|
||||
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
||||
Requires-Python: >=3.8
|
||||
Description-Content-Type: text/markdown
|
||||
License-File: LICENSE
|
||||
Requires-Dist: Django>=3.2
|
||||
Requires-Dist: psycopg2-binary>=2.9
|
||||
Dynamic: license-file
|
||||
|
||||
# Django-OpenGauss
|
||||
|
||||
Django-OpenGauss 是针对 openGauss 数据库的 Django 后端驱动,基于 PostgreSQL 适配并提供 openGauss 专属能力。
|
||||
|
||||
## 核心特性
|
||||
|
||||
- 兼容 Django ORM 的完整功能,支持 openGauss 特性
|
||||
- 内置连接池管理,便于生产环境部署
|
||||
- 针对 openGauss 的类型映射与 SQL 优化
|
||||
- 支持 Django 3.2 及以上版本、Python 3.8 及以上版本
|
||||
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
pip install django-opengauss
|
||||
```
|
||||
|
||||
## 基础配置
|
||||
|
||||
在 Django 的 `settings.py` 中添加数据库配置:
|
||||
|
||||
```python
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django_opengauss',
|
||||
'NAME': 'your_database_name',
|
||||
'USER': 'your_username',
|
||||
'PASSWORD': 'your_password',
|
||||
'HOST': 'localhost',
|
||||
'PORT': '5432', # 默认端口
|
||||
'OPTIONS': {
|
||||
'application_name': 'Django-OpenGauss',
|
||||
'connect_timeout': 30,
|
||||
'sslmode': 'disable', # 可选:require / verify-ca / verify-full
|
||||
'cursor_itersize': 2000,
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### openGauss 额外选项
|
||||
|
||||
- `application_name`:在 openGauss 活动监控中的客户端名称
|
||||
- `connect_timeout`:连接超时时间(秒)
|
||||
- `sslmode`:SSL 连接策略
|
||||
- `cursor_itersize`:服务端游标批量获取行数
|
||||
|
||||
## 环境要求
|
||||
|
||||
- Django >= 3.2
|
||||
- Python >= 3.8
|
||||
- psycopg2-binary >= 2.9
|
||||
- 可访问的 openGauss 数据库实例
|
||||
|
||||
## 数据类型支持
|
||||
|
||||
驱动对常见字段提供 openGauss 优化映射,例如:
|
||||
|
||||
| Django 字段 | openGauss 类型 |
|
||||
|-------------|----------------|
|
||||
| AutoField | serial |
|
||||
| BigAutoField| bigserial |
|
||||
| CharField | varchar |
|
||||
| TextField | text |
|
||||
| JSONField | jsonb |
|
||||
|
||||
更多字段映射可参考源码 `src/` 目录。
|
||||
|
||||
## 连接池
|
||||
|
||||
驱动内置连接池实现(位于 `src/pool.py`),提供基础的连接复用、健康检查能力,可通过数据库 `OPTIONS` 配置启用。
|
||||
|
||||
## 开发环境
|
||||
|
||||
```bash
|
||||
git clone <repo-url>
|
||||
python -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
> 提示:源码现位于 `src/` 目录中,而对外发布的包名仍为 `django_opengauss`,保持对现有项目的兼容。
|
||||
|
||||
## 测试
|
||||
|
||||
运行测试前请确保数据库可用,可在项目根目录下直接执行 `tests/` 中的脚本:
|
||||
|
||||
```bash
|
||||
python tests/functional_tests.py
|
||||
python tests/coverage_tests.py
|
||||
python tests/performance_tests.py compare --save-json tests/performance_compare.json
|
||||
```
|
||||
|
||||
更多细节与参数说明请参考 `tests/README.md`。
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
|
||||
## 贡献
|
||||
|
||||
欢迎通过 Issue 或 Pull Request 参与贡献。如需重大改动,请先创建 Issue 讨论方案。
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
LICENSE
|
||||
README.md
|
||||
pyproject.toml
|
||||
src/django_opengauss/__init__.py
|
||||
src/django_opengauss/base.py
|
||||
src/django_opengauss/client.py
|
||||
src/django_opengauss/creation.py
|
||||
src/django_opengauss/features.py
|
||||
src/django_opengauss/introspection.py
|
||||
src/django_opengauss/operations.py
|
||||
src/django_opengauss/pool.py
|
||||
src/django_opengauss/schema.py
|
||||
src/django_opengauss.egg-info/PKG-INFO
|
||||
src/django_opengauss.egg-info/SOURCES.txt
|
||||
src/django_opengauss.egg-info/dependency_links.txt
|
||||
src/django_opengauss.egg-info/requires.txt
|
||||
src/django_opengauss.egg-info/top_level.txt
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Django>=3.2
|
||||
psycopg2-binary>=2.9
|
||||
|
|
@ -1 +0,0 @@
|
|||
django_opengauss
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue