Skip to content

Commit 931e83d

Browse files
authored
feat: add OceanBase SQLAlchemy plugin support (#7)
* feat: add OceanBase SQLAlchemy plugin support
1 parent 963aa7a commit 931e83d

24 files changed

+2172
-1
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ jobs:
5757
name: wordpress-oceanbase-plugin
5858
path: oceanbase-wordpress-plugin.zip
5959

60+
- name: Set up Python for SQLAlchemy
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: '3.11'
64+
- name: Install Python dependencies
65+
run: |
66+
cd oceanbase-sqlalchemy-plugin
67+
pip install --upgrade pip
68+
pip install build twine wheel
69+
- name: Build SQLAlchemy Plugin
70+
run: |
71+
cd oceanbase-sqlalchemy-plugin
72+
python -m build
73+
- name: Archive SQLAlchemy Package
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: oceanbase-sqlalchemy-plugin
77+
path: oceanbase-sqlalchemy-plugin/dist/*
78+
6079
- name: Create GitHub Release
6180
id: create_release
6281
uses: actions/create-release@latest
@@ -92,3 +111,19 @@ jobs:
92111
asset_path: wordpress-oceanbase-plugin.zip
93112
asset_name: wordpress-oceanbase-plugin.zip
94113
asset_content_type: application/zip
114+
115+
- name: Upload SQLAlchemy Release Asset
116+
uses: actions/upload-release-asset@latest
117+
with:
118+
upload_url: ${{ steps.create_release.outputs.upload_url }}
119+
asset_path: oceanbase-sqlalchemy-plugin/dist/*.whl
120+
asset_name: oceanbase-sqlalchemy-plugin.whl
121+
asset_content_type: application/octet-stream
122+
123+
- name: Upload SQLAlchemy Source Release Asset
124+
uses: actions/upload-release-asset@latest
125+
with:
126+
upload_url: ${{ steps.create_release.outputs.upload_url }}
127+
asset_path: oceanbase-sqlalchemy-plugin/dist/*.tar.gz
128+
asset_name: oceanbase-sqlalchemy-plugin.tar.gz
129+
asset_content_type: application/gzip

.github/workflows/workflow.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,37 @@ jobs:
7373
uses: actions/upload-artifact@v4
7474
with:
7575
name: wordpress-oceanbase-plugin
76-
path: wordpress-oceanbase-plugin/*.zip
76+
path: wordpress-oceanbase-plugin/*.zip
77+
78+
sqlalchemy-plugin:
79+
name: Build OceanBase SQLAlchemy Plugin
80+
runs-on: ubuntu-latest
81+
steps:
82+
- name: Checkout Code
83+
uses: actions/checkout@v3
84+
85+
- name: Set up Python
86+
uses: actions/setup-python@v4
87+
with:
88+
python-version: '3.11'
89+
90+
- name: Install dependencies
91+
run: |
92+
cd oceanbase-sqlalchemy-plugin
93+
pip install --upgrade pip
94+
pip install ruff
95+
ruff check .
96+
ruff format . --check
97+
pip install build twine wheel
98+
pip install -e .
99+
100+
- name: Build Python package
101+
run: |
102+
cd oceanbase-sqlalchemy-plugin
103+
python -m build
104+
105+
- name: Upload Artifacts
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: oceanbase-sqlalchemy-plugin
109+
path: oceanbase-sqlalchemy-plugin/dist/*

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ OceanBase is a high-performance database compatible with both MySQL and Oracle p
1515
| [WordPress OceanBase Plugin](./wordpress-oceanbase-plugin/README.md) | Content Management | Fixes compatibility issues between WordPress and OceanBase MySQL tenants |
1616
| [OceanBase SQL Helper Plugin](./oceanbase-sql-helper-plugin/README.md) | Development Tools | VSCode extension for quick access to OceanBase SQL keywords documentation |
1717
| [Metabase OceanBase Plugin](./metabase-oceanbase-plugin/README.md) | Data Visualization | Enables Metabase to connect to OceanBase (MySQL/Oracle mode) |
18+
| [OceanBase SQLAlchemy Plugin](./oceanbase-sqlalchemy-plugin/README.md) | Python ORM | SQLAlchemy dialect for OceanBase Oracle mode, compatible with SQLAlchemy 1.3+ and 2.0+ |
1819

1920
------
2021

@@ -60,6 +61,14 @@ OceanBase is a high-performance database compatible with both MySQL and Oracle p
6061

6162
------
6263

64+
### ✅ OceanBase SQLAlchemy Plugin
65+
66+
- **Function**: SQLAlchemy dialect for OceanBase Oracle mode, fully compatible with SQLAlchemy 1.3.x and 2.0+, providing optimized SQL queries and constraint reflection.
67+
- **Use Case**: Using Python SQLAlchemy ORM framework to connect and operate OceanBase Oracle mode databases.
68+
- **Documentation**: [OceanBase SQLAlchemy Plugin](./oceanbase-sqlalchemy-plugin/README.md)
69+
70+
------
71+
6372
## 📚 Full Documentation Links
6473

6574
全屏复制
@@ -71,6 +80,7 @@ OceanBase is a high-performance database compatible with both MySQL and Oracle p
7180
| WordPress OceanBase Plugin | [WordPress OceanBase Plugin](./wordpress-oceanbase-plugin/README.md) |
7281
| OceanBase SQL Helper Plugin | [OceanBase SQL Helper Plugin](./oceanbase-sql-helper-plugin/README.md) |
7382
| Metabase OceanBase Plugin | [Metabase OceanBase Plugin](./metabase-oceanbase-plugin/README.md) |
83+
| OceanBase SQLAlchemy Plugin | [OceanBase SQLAlchemy Plugin](./oceanbase-sqlalchemy-plugin/README.md) |
7484

7585
------
7686

README_CN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ OceanBase 是一款兼容 MySQL 和 Oracle 协议的高性能数据库。本仓
1717
| [WordPress OceanBase 插件](./wordpress-oceanbase-plugin/README_CN.md) | 内容管理 | 修复 WordPress 与 OceanBase MySQL 租户的兼容性问题 |
1818
| [OceanBase SQL 助手插件](./oceanbase-sql-helper-plugin/README_CN.md) | 开发工具 | VSCode 插件,快速访问 OceanBase SQL 关键词文档 |
1919
| [Metabase OceanBase 插件](./metabase-oceanbase-plugin/README_CN.md) | 数据可视化 | 支持 Metabase 连接 OceanBase(MySQL/Oracle 模式) |
20+
| [OceanBase SQLAlchemy 插件](./oceanbase-sqlalchemy-plugin/README.md) | Python ORM | SQLAlchemy 方言,支持 OceanBase Oracle 模式,兼容 SQLAlchemy 1.3+ 和 2.0+ |
2021

2122
------
2223

@@ -62,6 +63,14 @@ OceanBase 是一款兼容 MySQL 和 Oracle 协议的高性能数据库。本仓
6263

6364
------
6465

66+
### ✅ OceanBase SQLAlchemy 插件
67+
68+
- **功能**:SQLAlchemy 方言,支持 OceanBase Oracle 模式,完全兼容 SQLAlchemy 1.3.x 和 2.0+,提供优化的 SQL 查询和约束反射。
69+
- **适用场景**:使用 Python SQLAlchemy ORM 框架连接和操作 OceanBase Oracle 模式数据库。
70+
- **详细文档**[OceanBase SQLAlchemy 插件](./oceanbase-sqlalchemy-plugin/README.md)
71+
72+
------
73+
6574
## 📚 完整文档链接
6675

6776
| 插件名称 | 文档链接 |
@@ -71,6 +80,7 @@ OceanBase 是一款兼容 MySQL 和 Oracle 协议的高性能数据库。本仓
7180
| WordPress OceanBase 插件 | [WordPress OceanBase 插件](./wordpress-oceanbase-plugin/README_CN.md) |
7281
| OceanBase SQL 助手插件 | [OceanBase SQL 助手插件](./oceanbase-sql-helper-plugin/README_CN.md) |
7382
| Metabase OceanBase 插件 | [Metabase OceanBase 插件](./metabase-oceanbase-plugin/README_CN.md) |
83+
| OceanBase SQLAlchemy 插件 | [OceanBase SQLAlchemy 插件](./oceanbase-sqlalchemy-plugin/README.md) |
7484

7585
------
7686

0 commit comments

Comments
 (0)