Skip to content

Conversation

@pangpang20
Copy link
Contributor

Description

This pull request consolidates multiple commits on the stable-4.2.x branch, focusing on improving the GaussDB-Django backend, enhancing testing infrastructure, and adding support for non-root users. Key changes include initializing the GaussDB backend by adapting PostgreSQL code, refining installation scripts, updating READMEs with detailed guides, and enhancing JSON field support. The commits also address test app configurations, schema editor improvements, and CI workflow setup, ensuring robust integration with Django and Wagtail.

The changes improve usability, performance, and compatibility for non-root users, streamline testing, and ensure the backend supports advanced database features like JSON fields and recursive many-to-many relationships.

Changes Made

  • Backend Initialization and Schema Enhancements:

    • Initialized GaussDB backend by copying and adapting PostgreSQL code.
    • Simplified backend by removing batched insert patches and disabling constraint deferral.
    • Fixed parse_indexdef method signature and corrected SQL patterns in introspection.py.
    • Enhanced schema.py with new SQL templates for column operations and fixed sql_drop_identity typo.
    • Updated backend vendor to gaussdb and added timezone support.
    • Enhanced index introspection for multiple access methods and refined JSON field support.
    • Added safe model representation and custom SQL compilation for CharField/TextField to handle None as empty strings.
  • Testing Infrastructure:

    • Added testing infrastructure with test app lists, setup scripts, and parallel testing support.
    • Updated test apps to include admin_changelist, admin_filters, proxy_models, model_fields, constraints, and db_functions.
    • Modified django_test_suite.sh to patch test cases for GaussDB empty string handling and removed PostgreSQL dependencies.
    • Simplified tox.ini by removing unnecessary directories and setting Django version to stable/4.2.x.
    • Updated django_test_apps.txt to dynamically check GaussDB version for JSON field support and fixed typos (e.g., or_lookupsmodel_fields to or_lookups).
  • Installation and Documentation:

    • Updated README.md with detailed GaussDB-Django installation guide, PyPI instructions, and Python version recommendations.
    • Enhanced wagtail_README.md with Wagtail deployment guide, non-root user setup, and example images.
    • Updated install_gaussdb_driver.sh for user-level installation, removing sudo where possible and configuring LD_LIBRARY_PATH in ~/.bashrc.
    • Added global .bak file ignore pattern to .gitignore and removed compiler.py.bak.
  • CI and Dependency Management:

    • Added GaussDB Django CI workflow and updated gaussdb_settings.py for local testing.
    • Updated tox-ci.yml to install dependencies via pip install ..
    • Removed pypy conditions from requirements and simplified black/flake8 commands in tox.ini.
  • Miscellaneous:

    • Added support for recursive many-to-many relationships and disabled boolean exists LHS in GaussDB backend.
    • Updated to support Django 4.2.x and simplified test app configurations.
    • Improved error handling and SQL composition in the GaussDB backend.

Testing

  • Ran the Django test suite with django_test_suite.sh across specified test apps (admin_changelist, admin_filters, proxy_models, model_fields, constraints, db_functions) and confirmed all tests pass.
  • Verified non-root user installation by executing install_gaussdb_driver.sh as a non-root user on HCE, CentOS (Hce2), Euler, and Kylin systems.
  • Tested Wagtail deployment using the updated wagtail_README.md guide, ensuring successful database migrations and environment setup.
  • Validated JSON field functionality by running queries with JSONArray and JSONObject and checking dynamic version detection.
  • Confirmed CI workflow functionality using tox-ci.yml and verified dependency installation with pip install ..
  • Tested LD_LIBRARY_PATH configuration and dynamic link library setup for non-root users, ensuring libpq is correctly detected.

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.
chenyunliang520 and others added 22 commits October 14, 2025 10:16
…and enhance GaussDBSQLCompiler for JSON handling
@5xuanwen 5xuanwen merged commit 5a1b431 into HuaweiCloudDeveloper:4.2.0 Oct 30, 2025
1 check passed
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