sqlalchemy-cubrid 1.12.2__tar.gz → 1.12.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlalchemy_cubrid-1.12.2/sqlalchemy_cubrid.egg-info → sqlalchemy_cubrid-1.12.4}/PKG-INFO +64 -39
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/README.md +63 -38
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/pyproject.toml +7 -6
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/setup.cfg +3 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/__init__.py +1 -1
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/base.py +54 -2
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/compiler.py +31 -11
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/dialect.py +97 -35
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/dml.py +51 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/types.py +15 -3
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4/sqlalchemy_cubrid.egg-info}/PKG-INFO +64 -39
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid.egg-info/SOURCES.txt +7 -2
- sqlalchemy_cubrid-1.12.4/test/test_annotate_release_contributors.py +162 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_base.py +18 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_bench_dialect_baseline.py +1 -1
- sqlalchemy_cubrid-1.12.4/test/test_check_release_note_quality.py +186 -0
- sqlalchemy_cubrid-1.12.4/test/test_check_release_note_wrap.py +145 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_ci_policy.py +13 -0
- sqlalchemy_cubrid-1.12.4/test/test_compiler.py +1933 -0
- sqlalchemy_cubrid-1.12.4/test/test_compiler_ddl.py +452 -0
- sqlalchemy_cubrid-1.12.4/test/test_compiler_dml.py +1258 -0
- sqlalchemy_cubrid-1.12.4/test/test_compiler_types.py +718 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_compose_release_changelog.py +105 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_dialect_offline.py +376 -8
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_extract_release_notes.py +14 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_makefile_targets.py +9 -7
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_packaging.py +15 -0
- sqlalchemy_cubrid-1.12.4/test/test_pool_soak.py +638 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_pr_title.py +43 -1
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_report_driver_versions.py +27 -0
- sqlalchemy_cubrid-1.12.4/test/test_server_restart.py +662 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_stress_pool.py +154 -2
- sqlalchemy_cubrid-1.12.4/test/test_support_claims.py +380 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_tool_versions.py +1 -5
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_transactional_ddl.py +13 -6
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_installs.py +55 -4
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_path_impact.py +55 -1
- sqlalchemy_cubrid-1.12.2/test/test_bench_artifact.py +0 -595
- sqlalchemy_cubrid-1.12.2/test/test_compiler.py +0 -4354
- sqlalchemy_cubrid-1.12.2/test/test_dialects.py +0 -110
- sqlalchemy_cubrid-1.12.2/test/test_server_restart.py +0 -326
- sqlalchemy_cubrid-1.12.2/test/test_support_claims.py +0 -124
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/AUTHORS +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/LICENSE +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/NOTICE +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/_sqlalchemy_cubrid_alembic.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/_compat.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/aio_pycubrid_dialect.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/alembic_impl.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/py.typed +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/pycubrid_dialect.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/requirements.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid/trace.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid.egg-info/dependency_links.txt +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid.egg-info/entry_points.txt +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid.egg-info/requires.txt +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/sqlalchemy_cubrid.egg-info/top_level.txt +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_agent_eval.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_agent_review_gate.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_aio_integration.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_aio_pycubrid_dialect.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_alembic.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_alembic_plugin.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_alembic_registration.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_alembic_roundtrip.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_alembic_safety_check.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_bench_compile.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_agents_docs.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_docs_links.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_docs_translation.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_integration_connection.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_not_all_skipped.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_release_title.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_check_translation_sync.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_collection_roundtrip.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_differential_lane.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_docs_provenance_hook.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_docs_reason.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_dogfood_orm.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_driver_differential.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_fuzz_insert.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_fuzz_reflection.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_fuzz_select.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_generate_llms_full.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_integration.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_integration_boolean_columns.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_integration_gate.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_integration_group_concat.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_integration_urls.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_json.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_kill_query_helper.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_known_failures.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_lint_changelog_sections.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_lob_value_contract.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_logging.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_make_integration.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_metamorphic.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_mutmut_sandbox.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_offline_lanes.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_prepare_release.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_profile_orm.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_pycubrid_dialect.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_pypi_duplicate_guard.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_readme_async_examples.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reconcile_release_labels.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reflection_enum_collection.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reflection_golden.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reflection_numeric_params.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reflection_probe.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_reflection_probe_shape.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_regression.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_release_detect.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_release_please_config.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_release_summary.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_release_workflows.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_report_test_results.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_requirements.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_scalar_execution_contract.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_show_create_table.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_show_create_table_server_output.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_sqlalchemy_range.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_suite.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_third_party_licenses.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_trace.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_types.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_unique_constraint_fallback.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_url_query_options.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_uuid_contract.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_verify_dist.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_wait_for_cubrid.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_cubriddb_cache.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_hygiene.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_test_results.py +0 -0
- {sqlalchemy_cubrid-1.12.2 → sqlalchemy_cubrid-1.12.4}/test/test_workflow_timeouts.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlalchemy-cubrid
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.4
|
|
4
4
|
Summary: CUBRID dialect for SQLAlchemy
|
|
5
5
|
Author-email: Yeongseon Choe <yeongseon.choe@gmail.com>, Gyeongjun Paik <paikend@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -52,7 +52,7 @@ Dynamic: license-file
|
|
|
52
52
|
|
|
53
53
|
**SQLAlchemy 2.0–2.1 dialect for the CUBRID database** — Python ORM, schema reflection, Alembic migrations, and type mapping for SQLAlchemy and CUBRID-specific types.
|
|
54
54
|
|
|
55
|
-
[🇰🇷 한국어](docs/README.ko.md) · [🇺🇸 English](README.md) · [🇨🇳 中文](docs/README.zh.md) · [🇮🇳 हिन्दी](docs/README.hi.md) · [🇩🇪 Deutsch](docs/README.de.md) · [🇷🇺 Русский](docs/README.ru.md)
|
|
55
|
+
[🇰🇷 한국어](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.ko.md) · [🇺🇸 English](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/README.md) · [🇨🇳 中文](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.zh.md) · [🇮🇳 हिन्दी](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.hi.md) · [🇩🇪 Deutsch](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.de.md) · [🇷🇺 Русский](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.ru.md)
|
|
56
56
|
|
|
57
57
|
<!-- BADGES:START -->
|
|
58
58
|
[](https://pypi.org/project/sqlalchemy-cubrid)
|
|
@@ -74,7 +74,7 @@ Dynamic: license-file
|
|
|
74
74
|
sqlalchemy-cubrid lets SQLAlchemy work with a CUBRID database. CUBRID itself is
|
|
75
75
|
a separate database server that must already be running; installing these
|
|
76
76
|
packages does not install CUBRID or create a database. New to CUBRID or to
|
|
77
|
-
SQLAlchemy? Follow [Your First SQLAlchemy Connection to CUBRID](docs/QUICKSTART.md):
|
|
77
|
+
SQLAlchemy? Follow [Your First SQLAlchemy Connection to CUBRID](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md):
|
|
78
78
|
it shows what to prepare when you already have a database, how to start a
|
|
79
79
|
disposable local one with Docker, and takes you on the recommended
|
|
80
80
|
`sqlalchemy-cubrid[pycubrid]` path to a first query and a first saved row. The
|
|
@@ -101,7 +101,7 @@ actively maintained SQLAlchemy dialect that supports the modern 2.0–2.1 API.
|
|
|
101
101
|
|
|
102
102
|
- **Status**: Production/Stable [](https://pypi.org/project/sqlalchemy-cubrid)
|
|
103
103
|
- Supported matrix: SQLAlchemy `>=2.0,<2.2`, CUBRID `10.2`, `11.0`, `11.2`, `11.4`, Python `3.11`–`3.15`
|
|
104
|
-
- Ordinary PRs run the full offline suite with the 95% coverage floor on one Ubuntu/Python 3.12 lane; high-risk changes add Python 3.14/CUBRID 11.4 live integration. Main/changed-weekly runs add Python 3.11/CUBRID 10.2 and run the offline suite on the oldest and newest supported Python (3.11, 3.15). The full supported integration matrix remains manual and release-gated. See [CI execution policy](docs/CI_POLICY.md).
|
|
104
|
+
- Ordinary PRs run the full offline suite with the 95% coverage floor on one Ubuntu/Python 3.12 lane; high-risk changes add Python 3.14/CUBRID 11.4 live integration. Main/changed-weekly runs add Python 3.11/CUBRID 10.2 and run the offline suite on the oldest and newest supported Python (3.11, 3.15). The full supported integration matrix remains manual and release-gated. See [CI execution policy](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CI_POLICY.md).
|
|
105
105
|
- An advisory SQLAlchemy pre-release canary logs its resolved version; a passing run alone does not establish 2.2 beta compatibility (see #778)
|
|
106
106
|
- See [Known Limitations](#known-limitations) for behavior boundaries and unsupported features
|
|
107
107
|
|
|
@@ -119,7 +119,11 @@ flowchart TD
|
|
|
119
119
|
aio --> server
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
See [full communication architecture](docs/ARCHITECTURE.md#end-to-end-communication-architecture) for the Broker, CAS and CCI path.
|
|
122
|
+
See [full communication architecture](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ARCHITECTURE.md#end-to-end-communication-architecture) for the Broker, CAS and CCI path.
|
|
123
|
+
|
|
124
|
+
CUBRID database server versions, CUBRIDdb GitHub source tags, PyPI package releases
|
|
125
|
+
and installed driver versions are distinct identifiers. See
|
|
126
|
+
[server and driver version terminology](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#server-driver-and-distribution-versions).
|
|
123
127
|
|
|
124
128
|
```mermaid
|
|
125
129
|
flowchart TD
|
|
@@ -137,7 +141,7 @@ environment and validate your application before upgrading.
|
|
|
137
141
|
|
|
138
142
|
- Python 3.11 or later
|
|
139
143
|
- SQLAlchemy 2.0 – 2.1
|
|
140
|
-
- [pycubrid](https://github.com/cubrid-lab/pycubrid) (pure Python, recommended) **or** the official CUBRIDdb C extension built from [cubrid-python](https://github.com/CUBRID/cubrid-python) v11.3.0.51
|
|
144
|
+
- [pycubrid](https://github.com/cubrid-lab/pycubrid) (pure Python, recommended) **or** the official CUBRIDdb C extension, installed from PyPI (`CUBRID-Python` 9.3.0) or built from the [cubrid-python](https://github.com/CUBRID/cubrid-python) v11.3.0.51 source release
|
|
141
145
|
|
|
142
146
|
## Installation
|
|
143
147
|
|
|
@@ -161,25 +165,36 @@ With Alembic support:
|
|
|
161
165
|
pip install "sqlalchemy-cubrid[alembic]"
|
|
162
166
|
```
|
|
163
167
|
|
|
164
|
-
With the CUBRIDdb C-extension driver (the bare `cubrid://` URL
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
With the CUBRIDdb C-extension driver (the bare `cubrid://` URL, or
|
|
169
|
+
`cubrid+cubriddb://` to select it explicitly), choose one of the two supported
|
|
170
|
+
installation options:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
pip install "sqlalchemy-cubrid[cubriddb]" # PyPI CUBRID-Python 9.3.0 (also [cubrid])
|
|
174
|
+
```
|
|
167
175
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
> integration suite. The dialect warns (`SAWarning`) at the first connection when it
|
|
172
|
-
> finds a CUBRIDdb older than 11.3. For new projects, use the recommended pure-Python
|
|
173
|
-
> `[pycubrid]` driver (the `cubrid+pycubrid://` URL). To select the CUBRIDdb C-extension
|
|
174
|
-
> driver explicitly, use the `cubrid+cubriddb://` URL.
|
|
176
|
+
or build CUBRIDdb from the [cubrid-python](https://github.com/CUBRID/cubrid-python)
|
|
177
|
+
v11.3.0.51 source release, which CI tests; see
|
|
178
|
+
[Building CUBRIDdb from source](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#building-cubriddb-from-source).
|
|
175
179
|
|
|
176
|
-
|
|
180
|
+
> **The PyPI 9.3.0 driver has known limitations.** It is not part of the required CI,
|
|
181
|
+
> and a manually dispatched lane on CUBRID 11.4 and Python 3.12 still fails part of the
|
|
182
|
+
> integration suite: the driver cannot bind `bytes`, raises constraint violations as
|
|
183
|
+
> `DatabaseError` and sends bound parameters as strings, which the server rejects in
|
|
184
|
+
> recursive CTEs and `SET` values. The dialect converts its `BIGINT` results to `int`
|
|
185
|
+
> and writes paged `LIMIT` values into the SQL. It warns (`SAWarning`) at the first
|
|
186
|
+
> connection when it finds a CUBRIDdb older than 11.3. See the
|
|
187
|
+
> [known limitations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#pypi-cubrid-python-93x-known-limitations).
|
|
188
|
+
> For new projects, use the recommended pure-Python `[pycubrid]` driver
|
|
189
|
+
> (the `cubrid+pycubrid://` URL).
|
|
190
|
+
|
|
191
|
+
<img src="https://raw.githubusercontent.com/cubrid-lab/sqlalchemy-cubrid/main/docs/demo.gif" alt="sqlalchemy-cubrid in action" width="100%"/>
|
|
177
192
|
|
|
178
193
|
## Quick Start
|
|
179
194
|
|
|
180
195
|
These short examples assume a running database named `demodb` and a `dba`
|
|
181
196
|
account whose password is `password`; replace the URL with your own values.
|
|
182
|
-
The [first-connection guide](docs/QUICKSTART.md) instead uses a local lab
|
|
197
|
+
The [first-connection guide](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md) instead uses a local lab
|
|
183
198
|
database, `testdb`, with no password. The ORM example creates a `users` table;
|
|
184
199
|
the async insert example creates and drops a table of its own.
|
|
185
200
|
|
|
@@ -354,28 +369,28 @@ after the statement (see [Known Limitations](#known-limitations)).
|
|
|
354
369
|
- **No sequences** — CUBRID uses `AUTO_INCREMENT` only
|
|
355
370
|
- **Single effective schema** — CUBRID exposes one schema per connection (the current user's schema); `get_schema_names()` reports that one schema and every reflection method honours `schema=` consistently (the default schema is reflected; any other schema yields no tables/views). Owner-qualified cross-schema reflection is not supported.
|
|
356
371
|
- **Uncommitted DDL holds schema locks** — CUBRID DDL is transactional (`ROLLBACK` undoes it; only client autocommit, which the dialect turns off, commits it early), so by default a whole Alembic upgrade is one transaction (`transactional_ddl = True`) and keeps the tables it touches locked until it commits; use `transaction_per_migration=True` for long or large-table migrations
|
|
357
|
-
- **SQLAlchemy 2.0–2.1 only** — capped at `<2.2`; SA 2.2 compatibility shims exist, but the advisory pre-release canary has not yet proven installation or compatibility of a published 2.2 beta (see #778) ([details](docs/ARCHITECTURE.md))
|
|
372
|
+
- **SQLAlchemy 2.0–2.1 only** — capped at `<2.2`; SA 2.2 compatibility shims exist, but the advisory pre-release canary has not yet proven installation or compatibility of a published 2.2 beta (see #778) ([details](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ARCHITECTURE.md))
|
|
358
373
|
- **Async requires pycubrid >= 1.8.0,<2.0** — the `cubrid+aiopycubrid://` driver needs the async-capable pycubrid package line currently supported by this project
|
|
359
374
|
- **CARDINALITY() broken** — `func.cardinality()` raises `CompileError` with workaround guidance; the CUBRID server has a [known bug](https://github.com/cubrid-lab/.github/issues/3)
|
|
360
375
|
- **Reserved words auto-quoted** — Column names matching CUBRID reserved words (`day`, `count`, `value`, etc.) are automatically double-quoted in DDL; see [reserved word list](https://github.com/cubrid-lab/.github/issues/5)
|
|
361
|
-
- **Timezone type reflection** — CUBRID's `TIMESTAMPTZ`, `TIMESTAMPLTZ`, `DATETIMETZ` and `DATETIMELTZ` reflect as distinct SQLAlchemy types (`sqlalchemy_cubrid.types.TIMESTAMPTZ`/`TIMESTAMPLTZ`/`DATETIMETZ`/`DATETIMELTZ`, each with `timezone=True`) rather than collapsing into plain `TIMESTAMP`/`DATETIME` (#181, #442); see [Type Mapping](docs/TYPES.md#type-reflection-ischema_names-only)
|
|
376
|
+
- **Timezone type reflection** — CUBRID's `TIMESTAMPTZ`, `TIMESTAMPLTZ`, `DATETIMETZ` and `DATETIMELTZ` reflect as distinct SQLAlchemy types (`sqlalchemy_cubrid.types.TIMESTAMPTZ`/`TIMESTAMPLTZ`/`DATETIMETZ`/`DATETIMELTZ`, each with `timezone=True`) rather than collapsing into plain `TIMESTAMP`/`DATETIME` (#181, #442); see [Type Mapping](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TYPES.md#type-reflection-ischema_names-only)
|
|
362
377
|
|
|
363
378
|
## Documentation
|
|
364
379
|
|
|
365
380
|
| Guide | Description |
|
|
366
381
|
|---|---|
|
|
367
|
-
| [Your First Connection](docs/QUICKSTART.md) | Start here: prepare a database, first query, first saved row, first-connection problems |
|
|
368
|
-
| [Connection](docs/CONNECTION.md) | Connection strings, URL format, driver setup, pool tuning |
|
|
369
|
-
| [Type Mapping](docs/TYPES.md) | Full type mapping, CUBRID-specific types, collection types |
|
|
370
|
-
| [DML Extensions](docs/DML_EXTENSIONS.md) | ON DUPLICATE KEY UPDATE, MERGE, REPLACE INTO, query trace |
|
|
371
|
-
| [Isolation Levels](docs/ISOLATION_LEVELS.md) | The three CUBRID MVCC isolation levels, configuration |
|
|
372
|
-
| [Alembic Migrations](docs/ALEMBIC.md) | Setup, configuration, limitations, batch workarounds |
|
|
373
|
-
| [Feature Support](docs/FEATURE_SUPPORT.md) | Comparison with MySQL, PostgreSQL, SQLite |
|
|
374
|
-
| [ORM Cookbook](docs/ORM_COOKBOOK.md) | Practical ORM examples, relationships, queries |
|
|
375
|
-
| [Development](docs/DEVELOPMENT.md) | Dev setup, testing, Docker, coverage, CI/CD |
|
|
376
|
-
| [Driver Compatibility](docs/DRIVER_COMPAT.md) | CUBRID-Python driver versions and known issues |
|
|
377
|
-
| [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues, error solutions, debugging techniques |
|
|
378
|
-
| [Async Connection](docs/CONNECTION.md#async-connection) | Async engine setup with `cubrid+aiopycubrid://` |
|
|
382
|
+
| [Your First Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md) | Start here: prepare a database, first query, first saved row, first-connection problems |
|
|
383
|
+
| [Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CONNECTION.md) | Connection strings, URL format, driver setup, pool tuning |
|
|
384
|
+
| [Type Mapping](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TYPES.md) | Full type mapping, CUBRID-specific types, collection types |
|
|
385
|
+
| [DML Extensions](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DML_EXTENSIONS.md) | ON DUPLICATE KEY UPDATE, MERGE, REPLACE INTO, query trace |
|
|
386
|
+
| [Isolation Levels](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ISOLATION_LEVELS.md) | The three CUBRID MVCC isolation levels, configuration |
|
|
387
|
+
| [Alembic Migrations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ALEMBIC.md) | Setup, configuration, limitations, batch workarounds |
|
|
388
|
+
| [Feature Support](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/FEATURE_SUPPORT.md) | Comparison with MySQL, PostgreSQL, SQLite |
|
|
389
|
+
| [ORM Cookbook](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ORM_COOKBOOK.md) | Practical ORM examples, relationships, queries |
|
|
390
|
+
| [Development](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DEVELOPMENT.md) | Dev setup, testing, Docker, coverage, CI/CD |
|
|
391
|
+
| [Driver Compatibility](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md) | CUBRID-Python driver versions and known issues |
|
|
392
|
+
| [Troubleshooting](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TROUBLESHOOTING.md) | Common issues, error solutions, debugging techniques |
|
|
393
|
+
| [Async Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CONNECTION.md#async-connection) | Async engine setup with `cubrid+aiopycubrid://` |
|
|
379
394
|
|
|
380
395
|
## Compatibility Matrix
|
|
381
396
|
|
|
@@ -397,7 +412,7 @@ from sqlalchemy import create_engine
|
|
|
397
412
|
engine = create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")
|
|
398
413
|
```
|
|
399
414
|
|
|
400
|
-
The recommended way is the pure-Python `pycubrid` driver: `create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")`. The driver requires no CUBRID native libraries. The `[pycubrid]` extra also installs `greenlet` for SQLAlchemy's async bridge; it may require build tools when no compatible wheel is available. The bare `cubrid://` URL uses the
|
|
415
|
+
The recommended way is the pure-Python `pycubrid` driver: `create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")`. The driver requires no CUBRID native libraries. The `[pycubrid]` extra also installs `greenlet` for SQLAlchemy's async bridge; it may require build tools when no compatible wheel is available. The bare `cubrid://` URL uses the CUBRIDdb C-extension driver, which has two supported installation options: the `[cubriddb]` (or `[cubrid]`) extra installs the PyPI `CUBRID-Python` 9.3.0 release, which has [known limitations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#pypi-cubrid-python-93x-known-limitations), or you can build it from the cubrid-python v11.3.0.51 source release, which CI tests. To select it explicitly and unambiguously use `cubrid+cubriddb://`.
|
|
401
416
|
|
|
402
417
|
### Does sqlalchemy-cubrid support SQLAlchemy 2.0–2.1?
|
|
403
418
|
|
|
@@ -434,7 +449,7 @@ stmt = insert(users).values(id=1, name="Alice").on_duplicate_key_update(name="Al
|
|
|
434
449
|
|
|
435
450
|
`cubrid://` uses the C-extension driver (CUBRIDdb) which requires compilation. `cubrid+pycubrid://` uses the pure Python driver, which requires no CUBRID native libraries. The `[pycubrid]` extra includes `greenlet`, whose installation may require build tools when no compatible wheel is available. `cubrid+aiopycubrid://` uses the async variant of the pure Python driver for use with `create_async_engine` and `AsyncSession`.
|
|
436
451
|
|
|
437
|
-
> **Recommendation:** for new projects prefer `cubrid+pycubrid://` (pure Python driver, no CUBRID native libraries). The `[pycubrid]` extra's `greenlet` dependency may need build tools. Use `cubrid+cubriddb://` with
|
|
452
|
+
> **Recommendation:** for new projects prefer `cubrid+pycubrid://` (pure Python driver, no CUBRID native libraries). The `[pycubrid]` extra's `greenlet` dependency may need build tools. Use `cubrid+cubriddb://` when you specifically need the C-extension driver, installed with the `[cubriddb]` extra or built from the cubrid-python v11.3.0.51 source release.
|
|
438
453
|
|
|
439
454
|
### Does sqlalchemy-cubrid support async?
|
|
440
455
|
|
|
@@ -448,13 +463,12 @@ Yes. Use `create_async_engine("cubrid+aiopycubrid://...")` with the pycubrid asy
|
|
|
448
463
|
|
|
449
464
|
## Roadmap
|
|
450
465
|
|
|
451
|
-
See [`ROADMAP.md`](ROADMAP.md) for this project's direction and next milestones.
|
|
466
|
+
See [`ROADMAP.md`](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/ROADMAP.md) for this project's direction and next milestones.
|
|
452
467
|
|
|
453
|
-
For the ecosystem-wide view, see the [CUBRID Labs Ecosystem Roadmap](https://github.com/cubrid-lab/.github/blob/main/ROADMAP.md).
|
|
454
468
|
|
|
455
469
|
## Contributing
|
|
456
470
|
|
|
457
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for development setup.
|
|
471
|
+
See [CONTRIBUTING.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/CONTRIBUTING.md) for guidelines and [docs/DEVELOPMENT.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DEVELOPMENT.md) for development setup.
|
|
458
472
|
|
|
459
473
|
### First contribution
|
|
460
474
|
|
|
@@ -468,9 +482,20 @@ Most first issues can be developed and tested with the offline checks in CONTRIB
|
|
|
468
482
|
|
|
469
483
|
Browse open [`good first issue`](https://github.com/cubrid-lab/sqlalchemy-cubrid/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) tasks.
|
|
470
484
|
|
|
485
|
+
## Getting help
|
|
486
|
+
|
|
487
|
+
Read the [first-connection guide](https://cubrid-lab.github.io/sqlalchemy-cubrid/QUICKSTART/)
|
|
488
|
+
and [troubleshooting guide](https://cubrid-lab.github.io/sqlalchemy-cubrid/TROUBLESHOOTING/)
|
|
489
|
+
first. For usage questions, use
|
|
490
|
+
[GitHub Discussions](https://github.com/cubrid-lab/sqlalchemy-cubrid/discussions).
|
|
491
|
+
For reproducible bugs, use the
|
|
492
|
+
[bug report template](https://github.com/cubrid-lab/sqlalchemy-cubrid/issues/new?template=bug_report.yml).
|
|
493
|
+
For all reporting options, see [SUPPORT.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/SUPPORT.md).
|
|
494
|
+
Report security vulnerabilities privately (see the next section), not in public issues.
|
|
495
|
+
|
|
471
496
|
## Security
|
|
472
497
|
|
|
473
|
-
Report vulnerabilities privately through GitHub's private vulnerability reporting (email is the fallback) -- see [SECURITY.md](SECURITY.md). Do not open public issues for security concerns.
|
|
498
|
+
Report vulnerabilities privately through GitHub's private vulnerability reporting (email is the fallback) -- see [SECURITY.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/SECURITY.md). Do not open public issues for security concerns.
|
|
474
499
|
|
|
475
500
|
## Disclaimer
|
|
476
501
|
|
|
@@ -479,4 +504,4 @@ Report vulnerabilities privately through GitHub's private vulnerability reportin
|
|
|
479
504
|
|
|
480
505
|
## License
|
|
481
506
|
|
|
482
|
-
MIT -- see [LICENSE](LICENSE).
|
|
507
|
+
MIT -- see [LICENSE](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/LICENSE).
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**SQLAlchemy 2.0–2.1 dialect for the CUBRID database** — Python ORM, schema reflection, Alembic migrations, and type mapping for SQLAlchemy and CUBRID-specific types.
|
|
10
10
|
|
|
11
|
-
[🇰🇷 한국어](docs/README.ko.md) · [🇺🇸 English](README.md) · [🇨🇳 中文](docs/README.zh.md) · [🇮🇳 हिन्दी](docs/README.hi.md) · [🇩🇪 Deutsch](docs/README.de.md) · [🇷🇺 Русский](docs/README.ru.md)
|
|
11
|
+
[🇰🇷 한국어](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.ko.md) · [🇺🇸 English](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/README.md) · [🇨🇳 中文](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.zh.md) · [🇮🇳 हिन्दी](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.hi.md) · [🇩🇪 Deutsch](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.de.md) · [🇷🇺 Русский](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/README.ru.md)
|
|
12
12
|
|
|
13
13
|
<!-- BADGES:START -->
|
|
14
14
|
[](https://pypi.org/project/sqlalchemy-cubrid)
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
sqlalchemy-cubrid lets SQLAlchemy work with a CUBRID database. CUBRID itself is
|
|
31
31
|
a separate database server that must already be running; installing these
|
|
32
32
|
packages does not install CUBRID or create a database. New to CUBRID or to
|
|
33
|
-
SQLAlchemy? Follow [Your First SQLAlchemy Connection to CUBRID](docs/QUICKSTART.md):
|
|
33
|
+
SQLAlchemy? Follow [Your First SQLAlchemy Connection to CUBRID](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md):
|
|
34
34
|
it shows what to prepare when you already have a database, how to start a
|
|
35
35
|
disposable local one with Docker, and takes you on the recommended
|
|
36
36
|
`sqlalchemy-cubrid[pycubrid]` path to a first query and a first saved row. The
|
|
@@ -57,7 +57,7 @@ actively maintained SQLAlchemy dialect that supports the modern 2.0–2.1 API.
|
|
|
57
57
|
|
|
58
58
|
- **Status**: Production/Stable [](https://pypi.org/project/sqlalchemy-cubrid)
|
|
59
59
|
- Supported matrix: SQLAlchemy `>=2.0,<2.2`, CUBRID `10.2`, `11.0`, `11.2`, `11.4`, Python `3.11`–`3.15`
|
|
60
|
-
- Ordinary PRs run the full offline suite with the 95% coverage floor on one Ubuntu/Python 3.12 lane; high-risk changes add Python 3.14/CUBRID 11.4 live integration. Main/changed-weekly runs add Python 3.11/CUBRID 10.2 and run the offline suite on the oldest and newest supported Python (3.11, 3.15). The full supported integration matrix remains manual and release-gated. See [CI execution policy](docs/CI_POLICY.md).
|
|
60
|
+
- Ordinary PRs run the full offline suite with the 95% coverage floor on one Ubuntu/Python 3.12 lane; high-risk changes add Python 3.14/CUBRID 11.4 live integration. Main/changed-weekly runs add Python 3.11/CUBRID 10.2 and run the offline suite on the oldest and newest supported Python (3.11, 3.15). The full supported integration matrix remains manual and release-gated. See [CI execution policy](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CI_POLICY.md).
|
|
61
61
|
- An advisory SQLAlchemy pre-release canary logs its resolved version; a passing run alone does not establish 2.2 beta compatibility (see #778)
|
|
62
62
|
- See [Known Limitations](#known-limitations) for behavior boundaries and unsupported features
|
|
63
63
|
|
|
@@ -75,7 +75,11 @@ flowchart TD
|
|
|
75
75
|
aio --> server
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
See [full communication architecture](docs/ARCHITECTURE.md#end-to-end-communication-architecture) for the Broker, CAS and CCI path.
|
|
78
|
+
See [full communication architecture](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ARCHITECTURE.md#end-to-end-communication-architecture) for the Broker, CAS and CCI path.
|
|
79
|
+
|
|
80
|
+
CUBRID database server versions, CUBRIDdb GitHub source tags, PyPI package releases
|
|
81
|
+
and installed driver versions are distinct identifiers. See
|
|
82
|
+
[server and driver version terminology](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#server-driver-and-distribution-versions).
|
|
79
83
|
|
|
80
84
|
```mermaid
|
|
81
85
|
flowchart TD
|
|
@@ -93,7 +97,7 @@ environment and validate your application before upgrading.
|
|
|
93
97
|
|
|
94
98
|
- Python 3.11 or later
|
|
95
99
|
- SQLAlchemy 2.0 – 2.1
|
|
96
|
-
- [pycubrid](https://github.com/cubrid-lab/pycubrid) (pure Python, recommended) **or** the official CUBRIDdb C extension built from [cubrid-python](https://github.com/CUBRID/cubrid-python) v11.3.0.51
|
|
100
|
+
- [pycubrid](https://github.com/cubrid-lab/pycubrid) (pure Python, recommended) **or** the official CUBRIDdb C extension, installed from PyPI (`CUBRID-Python` 9.3.0) or built from the [cubrid-python](https://github.com/CUBRID/cubrid-python) v11.3.0.51 source release
|
|
97
101
|
|
|
98
102
|
## Installation
|
|
99
103
|
|
|
@@ -117,25 +121,36 @@ With Alembic support:
|
|
|
117
121
|
pip install "sqlalchemy-cubrid[alembic]"
|
|
118
122
|
```
|
|
119
123
|
|
|
120
|
-
With the CUBRIDdb C-extension driver (the bare `cubrid://` URL
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
With the CUBRIDdb C-extension driver (the bare `cubrid://` URL, or
|
|
125
|
+
`cubrid+cubriddb://` to select it explicitly), choose one of the two supported
|
|
126
|
+
installation options:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
pip install "sqlalchemy-cubrid[cubriddb]" # PyPI CUBRID-Python 9.3.0 (also [cubrid])
|
|
130
|
+
```
|
|
123
131
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
> integration suite. The dialect warns (`SAWarning`) at the first connection when it
|
|
128
|
-
> finds a CUBRIDdb older than 11.3. For new projects, use the recommended pure-Python
|
|
129
|
-
> `[pycubrid]` driver (the `cubrid+pycubrid://` URL). To select the CUBRIDdb C-extension
|
|
130
|
-
> driver explicitly, use the `cubrid+cubriddb://` URL.
|
|
132
|
+
or build CUBRIDdb from the [cubrid-python](https://github.com/CUBRID/cubrid-python)
|
|
133
|
+
v11.3.0.51 source release, which CI tests; see
|
|
134
|
+
[Building CUBRIDdb from source](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#building-cubriddb-from-source).
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
> **The PyPI 9.3.0 driver has known limitations.** It is not part of the required CI,
|
|
137
|
+
> and a manually dispatched lane on CUBRID 11.4 and Python 3.12 still fails part of the
|
|
138
|
+
> integration suite: the driver cannot bind `bytes`, raises constraint violations as
|
|
139
|
+
> `DatabaseError` and sends bound parameters as strings, which the server rejects in
|
|
140
|
+
> recursive CTEs and `SET` values. The dialect converts its `BIGINT` results to `int`
|
|
141
|
+
> and writes paged `LIMIT` values into the SQL. It warns (`SAWarning`) at the first
|
|
142
|
+
> connection when it finds a CUBRIDdb older than 11.3. See the
|
|
143
|
+
> [known limitations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#pypi-cubrid-python-93x-known-limitations).
|
|
144
|
+
> For new projects, use the recommended pure-Python `[pycubrid]` driver
|
|
145
|
+
> (the `cubrid+pycubrid://` URL).
|
|
146
|
+
|
|
147
|
+
<img src="https://raw.githubusercontent.com/cubrid-lab/sqlalchemy-cubrid/main/docs/demo.gif" alt="sqlalchemy-cubrid in action" width="100%"/>
|
|
133
148
|
|
|
134
149
|
## Quick Start
|
|
135
150
|
|
|
136
151
|
These short examples assume a running database named `demodb` and a `dba`
|
|
137
152
|
account whose password is `password`; replace the URL with your own values.
|
|
138
|
-
The [first-connection guide](docs/QUICKSTART.md) instead uses a local lab
|
|
153
|
+
The [first-connection guide](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md) instead uses a local lab
|
|
139
154
|
database, `testdb`, with no password. The ORM example creates a `users` table;
|
|
140
155
|
the async insert example creates and drops a table of its own.
|
|
141
156
|
|
|
@@ -310,28 +325,28 @@ after the statement (see [Known Limitations](#known-limitations)).
|
|
|
310
325
|
- **No sequences** — CUBRID uses `AUTO_INCREMENT` only
|
|
311
326
|
- **Single effective schema** — CUBRID exposes one schema per connection (the current user's schema); `get_schema_names()` reports that one schema and every reflection method honours `schema=` consistently (the default schema is reflected; any other schema yields no tables/views). Owner-qualified cross-schema reflection is not supported.
|
|
312
327
|
- **Uncommitted DDL holds schema locks** — CUBRID DDL is transactional (`ROLLBACK` undoes it; only client autocommit, which the dialect turns off, commits it early), so by default a whole Alembic upgrade is one transaction (`transactional_ddl = True`) and keeps the tables it touches locked until it commits; use `transaction_per_migration=True` for long or large-table migrations
|
|
313
|
-
- **SQLAlchemy 2.0–2.1 only** — capped at `<2.2`; SA 2.2 compatibility shims exist, but the advisory pre-release canary has not yet proven installation or compatibility of a published 2.2 beta (see #778) ([details](docs/ARCHITECTURE.md))
|
|
328
|
+
- **SQLAlchemy 2.0–2.1 only** — capped at `<2.2`; SA 2.2 compatibility shims exist, but the advisory pre-release canary has not yet proven installation or compatibility of a published 2.2 beta (see #778) ([details](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ARCHITECTURE.md))
|
|
314
329
|
- **Async requires pycubrid >= 1.8.0,<2.0** — the `cubrid+aiopycubrid://` driver needs the async-capable pycubrid package line currently supported by this project
|
|
315
330
|
- **CARDINALITY() broken** — `func.cardinality()` raises `CompileError` with workaround guidance; the CUBRID server has a [known bug](https://github.com/cubrid-lab/.github/issues/3)
|
|
316
331
|
- **Reserved words auto-quoted** — Column names matching CUBRID reserved words (`day`, `count`, `value`, etc.) are automatically double-quoted in DDL; see [reserved word list](https://github.com/cubrid-lab/.github/issues/5)
|
|
317
|
-
- **Timezone type reflection** — CUBRID's `TIMESTAMPTZ`, `TIMESTAMPLTZ`, `DATETIMETZ` and `DATETIMELTZ` reflect as distinct SQLAlchemy types (`sqlalchemy_cubrid.types.TIMESTAMPTZ`/`TIMESTAMPLTZ`/`DATETIMETZ`/`DATETIMELTZ`, each with `timezone=True`) rather than collapsing into plain `TIMESTAMP`/`DATETIME` (#181, #442); see [Type Mapping](docs/TYPES.md#type-reflection-ischema_names-only)
|
|
332
|
+
- **Timezone type reflection** — CUBRID's `TIMESTAMPTZ`, `TIMESTAMPLTZ`, `DATETIMETZ` and `DATETIMELTZ` reflect as distinct SQLAlchemy types (`sqlalchemy_cubrid.types.TIMESTAMPTZ`/`TIMESTAMPLTZ`/`DATETIMETZ`/`DATETIMELTZ`, each with `timezone=True`) rather than collapsing into plain `TIMESTAMP`/`DATETIME` (#181, #442); see [Type Mapping](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TYPES.md#type-reflection-ischema_names-only)
|
|
318
333
|
|
|
319
334
|
## Documentation
|
|
320
335
|
|
|
321
336
|
| Guide | Description |
|
|
322
337
|
|---|---|
|
|
323
|
-
| [Your First Connection](docs/QUICKSTART.md) | Start here: prepare a database, first query, first saved row, first-connection problems |
|
|
324
|
-
| [Connection](docs/CONNECTION.md) | Connection strings, URL format, driver setup, pool tuning |
|
|
325
|
-
| [Type Mapping](docs/TYPES.md) | Full type mapping, CUBRID-specific types, collection types |
|
|
326
|
-
| [DML Extensions](docs/DML_EXTENSIONS.md) | ON DUPLICATE KEY UPDATE, MERGE, REPLACE INTO, query trace |
|
|
327
|
-
| [Isolation Levels](docs/ISOLATION_LEVELS.md) | The three CUBRID MVCC isolation levels, configuration |
|
|
328
|
-
| [Alembic Migrations](docs/ALEMBIC.md) | Setup, configuration, limitations, batch workarounds |
|
|
329
|
-
| [Feature Support](docs/FEATURE_SUPPORT.md) | Comparison with MySQL, PostgreSQL, SQLite |
|
|
330
|
-
| [ORM Cookbook](docs/ORM_COOKBOOK.md) | Practical ORM examples, relationships, queries |
|
|
331
|
-
| [Development](docs/DEVELOPMENT.md) | Dev setup, testing, Docker, coverage, CI/CD |
|
|
332
|
-
| [Driver Compatibility](docs/DRIVER_COMPAT.md) | CUBRID-Python driver versions and known issues |
|
|
333
|
-
| [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues, error solutions, debugging techniques |
|
|
334
|
-
| [Async Connection](docs/CONNECTION.md#async-connection) | Async engine setup with `cubrid+aiopycubrid://` |
|
|
338
|
+
| [Your First Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/QUICKSTART.md) | Start here: prepare a database, first query, first saved row, first-connection problems |
|
|
339
|
+
| [Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CONNECTION.md) | Connection strings, URL format, driver setup, pool tuning |
|
|
340
|
+
| [Type Mapping](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TYPES.md) | Full type mapping, CUBRID-specific types, collection types |
|
|
341
|
+
| [DML Extensions](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DML_EXTENSIONS.md) | ON DUPLICATE KEY UPDATE, MERGE, REPLACE INTO, query trace |
|
|
342
|
+
| [Isolation Levels](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ISOLATION_LEVELS.md) | The three CUBRID MVCC isolation levels, configuration |
|
|
343
|
+
| [Alembic Migrations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ALEMBIC.md) | Setup, configuration, limitations, batch workarounds |
|
|
344
|
+
| [Feature Support](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/FEATURE_SUPPORT.md) | Comparison with MySQL, PostgreSQL, SQLite |
|
|
345
|
+
| [ORM Cookbook](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/ORM_COOKBOOK.md) | Practical ORM examples, relationships, queries |
|
|
346
|
+
| [Development](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DEVELOPMENT.md) | Dev setup, testing, Docker, coverage, CI/CD |
|
|
347
|
+
| [Driver Compatibility](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md) | CUBRID-Python driver versions and known issues |
|
|
348
|
+
| [Troubleshooting](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/TROUBLESHOOTING.md) | Common issues, error solutions, debugging techniques |
|
|
349
|
+
| [Async Connection](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/CONNECTION.md#async-connection) | Async engine setup with `cubrid+aiopycubrid://` |
|
|
335
350
|
|
|
336
351
|
## Compatibility Matrix
|
|
337
352
|
|
|
@@ -353,7 +368,7 @@ from sqlalchemy import create_engine
|
|
|
353
368
|
engine = create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")
|
|
354
369
|
```
|
|
355
370
|
|
|
356
|
-
The recommended way is the pure-Python `pycubrid` driver: `create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")`. The driver requires no CUBRID native libraries. The `[pycubrid]` extra also installs `greenlet` for SQLAlchemy's async bridge; it may require build tools when no compatible wheel is available. The bare `cubrid://` URL uses the
|
|
371
|
+
The recommended way is the pure-Python `pycubrid` driver: `create_engine("cubrid+pycubrid://dba:password@localhost:33000/demodb")`. The driver requires no CUBRID native libraries. The `[pycubrid]` extra also installs `greenlet` for SQLAlchemy's async bridge; it may require build tools when no compatible wheel is available. The bare `cubrid://` URL uses the CUBRIDdb C-extension driver, which has two supported installation options: the `[cubriddb]` (or `[cubrid]`) extra installs the PyPI `CUBRID-Python` 9.3.0 release, which has [known limitations](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DRIVER_COMPAT.md#pypi-cubrid-python-93x-known-limitations), or you can build it from the cubrid-python v11.3.0.51 source release, which CI tests. To select it explicitly and unambiguously use `cubrid+cubriddb://`.
|
|
357
372
|
|
|
358
373
|
### Does sqlalchemy-cubrid support SQLAlchemy 2.0–2.1?
|
|
359
374
|
|
|
@@ -390,7 +405,7 @@ stmt = insert(users).values(id=1, name="Alice").on_duplicate_key_update(name="Al
|
|
|
390
405
|
|
|
391
406
|
`cubrid://` uses the C-extension driver (CUBRIDdb) which requires compilation. `cubrid+pycubrid://` uses the pure Python driver, which requires no CUBRID native libraries. The `[pycubrid]` extra includes `greenlet`, whose installation may require build tools when no compatible wheel is available. `cubrid+aiopycubrid://` uses the async variant of the pure Python driver for use with `create_async_engine` and `AsyncSession`.
|
|
392
407
|
|
|
393
|
-
> **Recommendation:** for new projects prefer `cubrid+pycubrid://` (pure Python driver, no CUBRID native libraries). The `[pycubrid]` extra's `greenlet` dependency may need build tools. Use `cubrid+cubriddb://` with
|
|
408
|
+
> **Recommendation:** for new projects prefer `cubrid+pycubrid://` (pure Python driver, no CUBRID native libraries). The `[pycubrid]` extra's `greenlet` dependency may need build tools. Use `cubrid+cubriddb://` when you specifically need the C-extension driver, installed with the `[cubriddb]` extra or built from the cubrid-python v11.3.0.51 source release.
|
|
394
409
|
|
|
395
410
|
### Does sqlalchemy-cubrid support async?
|
|
396
411
|
|
|
@@ -404,13 +419,12 @@ Yes. Use `create_async_engine("cubrid+aiopycubrid://...")` with the pycubrid asy
|
|
|
404
419
|
|
|
405
420
|
## Roadmap
|
|
406
421
|
|
|
407
|
-
See [`ROADMAP.md`](ROADMAP.md) for this project's direction and next milestones.
|
|
422
|
+
See [`ROADMAP.md`](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/ROADMAP.md) for this project's direction and next milestones.
|
|
408
423
|
|
|
409
|
-
For the ecosystem-wide view, see the [CUBRID Labs Ecosystem Roadmap](https://github.com/cubrid-lab/.github/blob/main/ROADMAP.md).
|
|
410
424
|
|
|
411
425
|
## Contributing
|
|
412
426
|
|
|
413
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md) for development setup.
|
|
427
|
+
See [CONTRIBUTING.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/CONTRIBUTING.md) for guidelines and [docs/DEVELOPMENT.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/docs/DEVELOPMENT.md) for development setup.
|
|
414
428
|
|
|
415
429
|
### First contribution
|
|
416
430
|
|
|
@@ -424,9 +438,20 @@ Most first issues can be developed and tested with the offline checks in CONTRIB
|
|
|
424
438
|
|
|
425
439
|
Browse open [`good first issue`](https://github.com/cubrid-lab/sqlalchemy-cubrid/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) tasks.
|
|
426
440
|
|
|
441
|
+
## Getting help
|
|
442
|
+
|
|
443
|
+
Read the [first-connection guide](https://cubrid-lab.github.io/sqlalchemy-cubrid/QUICKSTART/)
|
|
444
|
+
and [troubleshooting guide](https://cubrid-lab.github.io/sqlalchemy-cubrid/TROUBLESHOOTING/)
|
|
445
|
+
first. For usage questions, use
|
|
446
|
+
[GitHub Discussions](https://github.com/cubrid-lab/sqlalchemy-cubrid/discussions).
|
|
447
|
+
For reproducible bugs, use the
|
|
448
|
+
[bug report template](https://github.com/cubrid-lab/sqlalchemy-cubrid/issues/new?template=bug_report.yml).
|
|
449
|
+
For all reporting options, see [SUPPORT.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/SUPPORT.md).
|
|
450
|
+
Report security vulnerabilities privately (see the next section), not in public issues.
|
|
451
|
+
|
|
427
452
|
## Security
|
|
428
453
|
|
|
429
|
-
Report vulnerabilities privately through GitHub's private vulnerability reporting (email is the fallback) -- see [SECURITY.md](SECURITY.md). Do not open public issues for security concerns.
|
|
454
|
+
Report vulnerabilities privately through GitHub's private vulnerability reporting (email is the fallback) -- see [SECURITY.md](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/SECURITY.md). Do not open public issues for security concerns.
|
|
430
455
|
|
|
431
456
|
## Disclaimer
|
|
432
457
|
|
|
@@ -435,4 +460,4 @@ Report vulnerabilities privately through GitHub's private vulnerability reportin
|
|
|
435
460
|
|
|
436
461
|
## License
|
|
437
462
|
|
|
438
|
-
MIT -- see [LICENSE](LICENSE).
|
|
463
|
+
MIT -- see [LICENSE](https://github.com/cubrid-lab/sqlalchemy-cubrid/blob/main/LICENSE).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77", "wheel"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -36,10 +36,11 @@ dependencies = [
|
|
|
36
36
|
]
|
|
37
37
|
|
|
38
38
|
[project.optional-dependencies]
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
39
|
+
# Maintained installation options for the CUBRIDdb C-extension driver (#1139,
|
|
40
|
+
# #1141). Both install the newest CUBRID-Python release on PyPI, 9.3.0 (pip
|
|
41
|
+
# reports it as 9.3.0.1). The other supported CUBRIDdb line is a build of the
|
|
42
|
+
# cubrid-python v11.3.0.51 source release, which is not on PyPI. Known 9.3.x
|
|
43
|
+
# limitations are in docs/DRIVER_COMPAT.md; pycubrid is recommended for new projects.
|
|
43
44
|
cubrid = [
|
|
44
45
|
"CUBRID-Python",
|
|
45
46
|
]
|
|
@@ -76,7 +77,7 @@ test = [
|
|
|
76
77
|
"defusedxml>=0.7.1",
|
|
77
78
|
]
|
|
78
79
|
lint = [
|
|
79
|
-
"ruff==0.17.
|
|
80
|
+
"ruff==0.17.5",
|
|
80
81
|
]
|
|
81
82
|
typecheck = [
|
|
82
83
|
"mypy==2.4.1",
|
|
@@ -18,6 +18,9 @@ pytest_add_cli_args =
|
|
|
18
18
|
not integration
|
|
19
19
|
pytest_add_cli_args_test_selection =
|
|
20
20
|
test/test_compiler.py
|
|
21
|
+
test/test_compiler_ddl.py
|
|
22
|
+
test/test_compiler_dml.py
|
|
23
|
+
test/test_compiler_types.py
|
|
21
24
|
test/test_dialect_offline.py
|
|
22
25
|
test/test_types.py
|
|
23
26
|
test/test_json.py
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
from __future__ import annotations
|
|
11
11
|
|
|
12
12
|
import logging
|
|
13
|
-
from typing import Any
|
|
13
|
+
from typing import Any, Callable, Optional
|
|
14
14
|
|
|
15
|
+
from sqlalchemy import types as sqltypes
|
|
15
16
|
from sqlalchemy.engine import default
|
|
16
17
|
from sqlalchemy.sql import compiler
|
|
17
18
|
|
|
@@ -388,9 +389,57 @@ class CubridIdentifierPreparer(compiler.IdentifierPreparer):
|
|
|
388
389
|
super().__init__(dialect, initial_quote, final_quote, escape_quote, omit_schema)
|
|
389
390
|
|
|
390
391
|
|
|
392
|
+
# DB-API type code CUBRIDdb reports in cursor.description for a BIGINT column
|
|
393
|
+
# (CUBRIDdb.FIELD_TYPE.BIGINT, the CCI U_TYPE_BIGINT value).
|
|
394
|
+
_CUBRIDDB_BIGINT_TYPE_CODE = 21
|
|
395
|
+
|
|
396
|
+
|
|
391
397
|
class CubridExecutionContext(default.DefaultExecutionContext):
|
|
392
398
|
"""Execution context for CUBRID connections."""
|
|
393
399
|
|
|
400
|
+
def get_result_processor(
|
|
401
|
+
self, type_: Any, colname: str, coltype: Any
|
|
402
|
+
) -> Optional[Callable[[Any], Any]]:
|
|
403
|
+
"""Convert numbers that CUBRIDdb older than 11.3 returns as ``str``.
|
|
404
|
+
|
|
405
|
+
Those releases fetch BIGINT, ``COUNT(*)`` and ``ROWNUM`` values as
|
|
406
|
+
decimal strings (``'5'``), while CUBRIDdb 11.3 and pycubrid return
|
|
407
|
+
``int`` (#1145). Only a ``str`` value in a column that the driver
|
|
408
|
+
reports as BIGINT and that SQLAlchemy types as an integer or leaves
|
|
409
|
+
untyped is converted, before the type's own result processor runs.
|
|
410
|
+
|
|
411
|
+
They also fetch columns without a fixed type (CCI type code 0, such as
|
|
412
|
+
``PERCENTILE_DISC(...) WITHIN GROUP (ORDER BY <condition>)``) as
|
|
413
|
+
``str``, and ``Boolean``'s processor would turn ``'0'`` into ``True``.
|
|
414
|
+
CUBRID has no BOOLEAN type, so a Boolean value is always a number: a
|
|
415
|
+
``str`` in a Boolean-typed column of any type code is converted with
|
|
416
|
+
``float()``, which also reads the ``'0.5000000000000000'`` of a
|
|
417
|
+
``PERCENTILE_CONT`` the way pycubrid's ``0.5`` is read, and non-numeric
|
|
418
|
+
text raises ``ValueError`` instead of becoming ``True`` (#1143). Text
|
|
419
|
+
from any other column or type is never parsed, and DDL, casts and bind
|
|
420
|
+
processing are unaffected.
|
|
421
|
+
"""
|
|
422
|
+
processor = super().get_result_processor(type_, colname, coltype)
|
|
423
|
+
if not getattr(self.dialect, "_bigint_results_as_str", False):
|
|
424
|
+
return processor
|
|
425
|
+
affinity = type_._type_affinity
|
|
426
|
+
if affinity is sqltypes.Boolean:
|
|
427
|
+
convert: Callable[[str], Any] = float
|
|
428
|
+
elif coltype == _CUBRIDDB_BIGINT_TYPE_CODE and affinity in (
|
|
429
|
+
sqltypes.Integer,
|
|
430
|
+
sqltypes.NullType,
|
|
431
|
+
):
|
|
432
|
+
convert = int
|
|
433
|
+
else:
|
|
434
|
+
return processor
|
|
435
|
+
|
|
436
|
+
def process(value: Any) -> Any:
|
|
437
|
+
if isinstance(value, str):
|
|
438
|
+
value = convert(value)
|
|
439
|
+
return processor(value) if processor is not None else value
|
|
440
|
+
|
|
441
|
+
return process
|
|
442
|
+
|
|
394
443
|
def get_lastrowid(self) -> int | None: # type: ignore[override]
|
|
395
444
|
"""Return the last inserted row ID.
|
|
396
445
|
|
|
@@ -413,7 +462,10 @@ class CubridExecutionContext(default.DefaultExecutionContext):
|
|
|
413
462
|
try:
|
|
414
463
|
cursor.execute("SELECT LAST_INSERT_ID()")
|
|
415
464
|
row = cursor.fetchone()
|
|
416
|
-
|
|
465
|
+
# LAST_INSERT_ID() is NULL until the connection has inserted into an
|
|
466
|
+
# AUTO_INCREMENT column. SQLAlchemy asks for lastrowid after every
|
|
467
|
+
# single-row INSERT, including tables without one (#1302).
|
|
468
|
+
if row and row[0] is not None:
|
|
417
469
|
return int(row[0])
|
|
418
470
|
finally:
|
|
419
471
|
cursor.close()
|