Repository navigation
Release v1.0.0.dev8 - #18
Merged
Merged
Conversation
Replace `from tests.providers.scenarios` and `from tests.rhosocial...` imports with local implementations to match the coding style used in other test files. This ensures tests can run with both `pytest tests/` and `python -m pytest tests/` without path issues.
… PostgreSQL (#16) * feat(backend): add explain() interface with typed PostgresExplainResult Implement backend.explain(expression, options) for PostgresBackend and AsyncPostgresBackend, following the sync/async parity principle. Changes: - New postgres/explain/ submodule with PostgresExplainPlanLine (wraps the single "QUERY PLAN" column per row) and PostgresExplainResult with analyze_index_usage() / is_full_scan / is_index_used / is_covering_index helpers (text-matching on Seq Scan / Index Scan / Index Only Scan keywords) - PostgresBackend and AsyncPostgresBackend now mixin SyncExplainBackendMixin and AsyncExplainBackendMixin respectively - Override _parse_explain_result() to extract "QUERY PLAN" key from each raw row and construct typed PostgresExplainPlanLine objects - Add format_explain_statement() to PostgresDialect using PostgreSQL bracket-option syntax: EXPLAIN [(ANALYZE, FORMAT JSON)] stmt - Export PostgresExplainResult and PostgresExplainPlanLine from the package __init__ (postgres execute() already included EXPLAIN in its DQL detection tuple — no fix needed) - Add integration tests covering protocol check, result structure, full-scan / index detection, EXPLAIN ANALYZE, and async parity * fix(dialect): return complete (sql, params) tuple from format_explain_statement The overridden format_explain_statement() in PostgresDialect was returning a plain str (the EXPLAIN prefix only), while ExplainExpression.to_sql() passes the return value directly to backend_mixin which unpacks it as (sql, params). This caused a ValueError at runtime. Fix by building the full EXPLAIN SQL string inside the method and returning (sql, params) consistent with the base class contract. Also fix test_backend_explain.py: replace executescript() calls (a MySQL-only method) with per-statement execute() calls, matching the pattern used in all other PostgreSQL backend tests. Add EXPLAIN documentation (en_US and zh_CN) and update the feature index README files. * feat(backend): add dual-layer connection recovery for PostgreSQL Implement automatic reconnection mechanism with two layers: - Plan A: Pre-query connection check in _get_cursor() using psycopg's closed/broken attributes - Plan B: Error retry mechanism in execute() detecting connection errors via SQLSTATE codes and error message patterns Supported connection error SQLSTATE codes: - 08000-08007: Connection exception class - 57P01-57P04: Server shutdown class Added fixtures for connection resilience testing and comprehensive documentation covering connection loss scenarios and recovery behavior. * ci: update rhosocial-activerecord installation source to git+https Install from release/v1.0.0.dev21 branch instead of PyPI dev20. * chore: add changelog fragment for PR #16
…pect usage examples (#17) * feat(cli): improve info command with connection status and add introspect usage examples - Display connection status in info command output - Show "(from actual connection)" when connected to database - Show "(default value - no database connection)" when not connected - Use actual dialect from backend instead of creating new instance - Display installed extensions when connected - Add detailed usage examples to introspect subcommand help - Examples for all introspection types (tables, views, columns, etc.) - JSON output example - Schema parameter example (PostgreSQL specific) - Environment variables connection example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: add changelog fragment for PR #17 --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
- Add WorkerTestProtocol implementation to BasicProvider and QueryProvider - Add supports_for_update() method to PostgresDialect - Add worker pool tests for basic and query features: - Worker pool lifecycle management - Parallel CRUD operations - Connection management - Parallel query execution - Transaction isolation - Add parallel workers scenario documentation (EN/CN) - Add parallel workers example code - Update CI to use git branch for testsuite installation
- Remove conftest.py files with pytest_plugins (not allowed in non-top-level) - Remove __init__.py files that cause module resolution conflicts - Fix bridge files to import correct fixtures (user_class_for_worker)
Renamed test_transaction_isolation.py to test_worker_transaction_isolation.py to avoid conflict with feature/backend/test_transaction_isolation.py
Change installation source from GitHub to PyPI for rhosocial-activerecord, fixed at version 1.0.0.dev21. This simplifies dependency management and aligns with the package being published to PyPI.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18 +/- ##
========================================
Coverage 71.69% 71.70%
========================================
Files 110 112 +2
Lines 6030 6191 +161
Branches 959 991 +32
========================================
+ Hits 4323 4439 +116
- Misses 1415 1440 +25
- Partials 292 312 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Release v1.0.0.dev8
Summary
This release adds EXPLAIN clause support, connection recovery, CLI improvements, and parallel worker processing support for PostgreSQL backend.
Changes
Added
infocommand with connection status display and add introspect usage examples (feat(cli): improve info command with connection status and add introspect usage examples #17)Fixed
Changed
tests.*importsCommits
e215146f99aa770588eed2f5200a757f03e8a7f11cb318ac7afc3c1fd042c213225ca6Version
1.0.0.dev8release/v1.0.0.dev8mainChecklist
pyproject.tomlRelated PRs