Skip to content

Conversation

@pangpang20
Copy link
Contributor

Description

This pull request integrates and enhances the GaussDB backend for Django, introducing comprehensive testing infrastructure, refined schema handling, and extended support for Django features like JSON fields and timezone handling. The changes on the stable-5.2.x branch, focusing on adapting Django's testing suite for GaussDB, optimizing backend functionality, and adding deployment documentation for Wagtail integration.

Changes Made

  • Initialized GaussDB backend by copying and adapting PostgreSQL code.
  • Added testing infrastructure with test app lists, setup scripts, and parallel testing support.
  • Renamed package to gaussdb_django and updated .gitignore to ignore specific Django subdirectories.
  • Removed embedded Django repository and restored full Django test app list.
  • Simplified GaussDB backend by removing unnecessary patches and disabling unsupported features.
  • Fixed method signatures and SQL patterns in schema.py and introspection.py for accurate column and index handling.
  • Enhanced schema.py with new SQL templates for column operations and updated vendor to 'gaussdb'.
  • Added support for recursive M2M relationships, timezone handling, and JSON field support with dynamic version checking.
  • Updated Django test suite to include apps like admin_changelist, admin_filters, proxy_models, model_fields, constraints, and db_functions.
  • Refactored test scripts (django_test_suite.sh) to remove PostgreSQL dependencies and patch test cases for GaussDB compatibility.
  • Enhanced README with installation guides, Python version recommendations, and test configuration details.
  • Added CI workflow (tox-ci.yml, tox.ini) for automated testing with stable Django 5.2.x and simplified linting commands.
  • Included Wagtail deployment guide with example images for GaussDB integration.

Testing

  • Configured comprehensive Django test suite with apps like migrations, admin_changelist, admin_filters, proxy_models, model_fields, constraints, and db_functions.
  • Enabled parallel testing and validated compatibility with GaussDB-specific features.
  • Updated django_test_apps.txt to dynamically adjust test apps based on GaussDB version, particularly for JSON field support.
  • Ran CI workflows using tox.ini and tox-ci.yml to ensure consistent builds and dependency installation.
  • Manually tested Wagtail deployment with GaussDB to verify integration steps and example images.

Additional Notes

  • The changes ensure compatibility with Django 5.2.x and focus on GaussDB-specific optimizations.
  • The Wagtail deployment guide assumes a standard setup; additional configurations may be required for custom environments.
  • Future improvements could include expanding test coverage for edge cases and further optimizing JSON field handling.

chenyunliang520 added 30 commits September 9, 2025 21:49
…yproject.toml, tox.ini, and TiDB settings for GaussDB Django backend.
…, updating scripts and settings, and limiting tests to backends app.
…o_tests_dir instead of the entire directory.
…backup file, update cursor classes in base.py, and modify GaussDB settings for port, user, auto field, and add cache configuration.
… GaussDB backend to use gaussdb module, and add environment setup and batched insert patch in gaussdb_settings.py.
…UNNEST optimization, updating import paths, and reverting to default host/port in gaussdb_settings.py.
…rect compiler_module path in operations.py.
…olumns by escaping percentage sign in LIKE clause.
…erations and foreign key handling to support schema alterations.
…oving custom column operations, and add Django settings for apps, middleware, templates, logging, and manage.py.
…ng handling and enhance schema.py with custom add_field logic for non-null fields.
…BindingCursor in base.py, adjust compiler.py to remove PostgreSQL-specific flag, update features.py to disable certain GaussDB features, and simplify schema.py by removing custom add_field logic.
…al, add feature flag, and change default GaussDB host/port
…to remove identity column usage, adjust database features, and update settings for safer tempfile handling and host/port configuration.
…DB features; update datetime cast SQL and switch to localhost in GaussDB settings.
@5xuanwen 5xuanwen merged commit 0535a82 into HuaweiCloudDeveloper:5.2.0 Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants