已合并
examples: Django + PyMySQL via dolphin MySQL protocol (Issue #34) #103
examples: Django + PyMySQL via dolphin MySQL protocol (Issue #34) #103
已合并
Yhw050920创建于 8月5日
Yhw050920
Yhw050920
8月5日

关联 Issue

https://gitcode.com/opengauss/opensource-intership/issues/34

对应开源实习任务:[开源实习] openGauss B库B协议适配MySQL python orm框架 Django #34(20 分)。

背景与目标

openGauss 通过 dolphin 插件提供 MySQL 协议兼容。本 PR 提供 Django + PyMySQL 示例,验证经 dolphin(3308)连接 openGauss B 兼容模式 的原生 ORM CRUD。

默认使用原生 django.db.backends.mysql;依赖 Plugin:

  • !2522 NO_BACKSLASH_ESCAPES
  • !2524 @@default_storage_engine / @@sql_auto_is_null

变更说明

  1. 新增 DjangoConnectOpenGaussB/:ENGINE=django.db.backends.mysql
  2. pymysql_bootstrap.py:注册 PyMySQL;识别 openGauss VERSION() banner 时解析为 MySQL 8.0.28
  3. 过渡 Backend:opengauss_mysql(未合入 Plugin 时可用)
  4. 设计文档 / 自测报告 / 测试思维导图
  5. 密码仅环境变量注入;验收截图仅在本 PR 描述中以图片展示

测试环境(2026-09-14 复验)

项 值
OS openEuler 20.03 LTS x86_64
DB openGauss 7.0.0 build 4769a5b7(含 Plugin !2522/!2524 dolphin)
协议 dolphin MySQL,端口 3308
客户端 Django 5.0.14 + PyMySQL 2.2.8
ENGINE django.db.backends.mysql(原生)

验收截图

1. 版本信息(openGauss / Django / PyMySQL)

版本信息

2. Plugin !2524 GUC(default_storage_engine=InnoDB,sql_auto_is_null=0)

GUC 兼容桩

3. 原生 Django Demo(含特殊字符 O'Brien\test,输出 DEMO_OK)

DEMO_OK

配套 PR


当前PR是否有AI参与:

希望检视人员了解:

  1. 代码由AI辅助开发者编写,且开发者已人工逐行核对逻辑、校验功能正确性,且与开发者预期一致;
  2. Commit 声明与本描述一致:Assisted-by: Cursor/Auto
  3. 已签署 CLA;设计文档已提交
  4. 关联 Issue: https://gitcode.com/opengauss/opensource-intership/issues/34
likedislike
Pull Request已成功合入, 合并人@opengauss_bot
(感谢 Yhw050920 的贡献)
Yhw050920Yhw050920
8月5日 创建了 pull request,commit 4f615434
opengauss_botopengauss_bot成员
8月5日 添加了label:sig/Infra
opengauss_bot
opengauss_bot成员
8月5日 评论:

Welcome To openGauss Community

Hey @hongwei-2026 , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: Infra ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @ailoooong, @gzbang, @libiao2024, @zhangxubo .

likedislike
opengauss_botopengauss_bot成员
8月5日 添加了label:stat/needs-squash
opengauss_botopengauss_bot成员
8月5日 添加了label:opengauss-cla/no
此处折叠了121条消息 查看更多
opengauss_bot
opengauss_bot成员
21 天前 评论:

Review Code Feedback

  • The label lgtm-ywzq1161327784, approved was added to this pull request. It means that ywzq1161327784 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
opengauss_botopengauss_bot成员
21 天前 合入了pull request,合并节点 SHA:696a7d89b24efb59427769d1bb86f89dcb2b7659
wofanzheng
wofanzheng成员
21 天前 评论:

@hongwei-2026 单 commit 要求检查:本 PR 合入时包含 7 个 commits,不符合“每个 PR 最终只保留 1 个 commit”的统一要求。

该 PR 已经合入,现有历史无法再通过源分支 squash 修正,因此这里只记录历史不符合项,不要求对已合入 PR 强行改写。后续任务 PR 必须在合入前将本 PR 的全部改动整理为一个 commit,并确认 PR 提交列表只剩 1 条。

likedislike
Yhw050920Yhw050920
15 天前 修改标题为 “examples: Django + PyMySQL via dolphin MySQL protocol (Issue #34)”,原标题为“【实习#34】新增 Django 经 MySQL 协议连接 openGauss B 库示例与自测”
Yhw050920Yhw050920
15 天前 修改了pull request 的描述