Skip to content

v4.2.11#82

Merged
Power2All merged 2 commits into
masterfrom
v4.2.11
May 25, 2026
Merged

v4.2.11#82
Power2All merged 2 commits into
masterfrom
v4.2.11

Conversation

@Power2All

@Power2All Power2All commented May 25, 2026

Copy link
Copy Markdown
Owner

v4.2.11

  • Fixing a database (PostgreSQL) implementation code (Thanks zmiguel)
  • Bumping version of SQLx, needed to modify the code to use the newer SQLx functions properly

Summary by CodeRabbit

  • Bug Fixes

    • Fixed PostgreSQL database implementation issue
  • Chores

    • Version bumped to 4.2.11
    • Upgraded SQLx dependency to 0.9.0 with enhanced TLS support
    • Updated Docker build configuration
    • Updated desktop application metadata

Review Change Stack

@Power2All Power2All self-assigned this May 25, 2026
@Power2All Power2All added bug Something isn't working enhancement New feature or request labels May 25, 2026
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ce14032-330a-4a7d-8594-e4525f279ce8

📥 Commits

Reviewing files that changed from the base of the PR and between f95ba67 and 7ba9fd7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • Cargo.toml
  • README.md
  • docker/Dockerfile
  • docker/build.bat
  • src/database/database.rs
  • src/database/impls/database_connector.rs
  • src/database/impls/database_connector_mysql.rs
  • src/database/impls/database_connector_pgsql.rs
  • src/database/impls/database_connector_sqlite.rs
  • torrust-actix.desktop

📝 Walkthrough

Walkthrough

This PR upgrades SQLx from 0.8.6 to 0.9.0 and adapts all database connector implementations (MySQL, PostgreSQL, SQLite) to wrap dynamically constructed SQL statements with sqlx::AssertSqlSafe() to satisfy the new version's stricter compile-time SQL validation. Version metadata across build and deployment artifacts is bumped to 4.2.11.

Changes

Release 4.2.11

Layer / File(s) Summary
Version and metadata bumps
Cargo.toml, README.md, docker/Dockerfile, docker/build.bat, torrust-actix.desktop
Package version, bundle version, README changelog, Docker image tags, and desktop entry are all incremented to 4.2.11.

SQLx 0.9.0 Migration

Layer / File(s) Summary
SQLx upgrade and core database integration
Cargo.toml, src/database/database.rs, src/database/impls/database_connector.rs
SQLx dependency upgraded from 0.8.6 to 0.9.0 with TLS runtime feature adjustment. PostgreSQL's format_hex_select removes the encode(..., 'hex') AS ... SQL generation for binary paths, returning only the quoted column identifier. Generic clear_table wraps dynamic SQL with sqlx::AssertSqlSafe().
MySQL connector SQLx safety wrapping
src/database/impls/database_connector_mysql.rs
All table creation, torrent/whitelist/blacklist/key/user CRUD, and seed/peer reset operations wrap dynamic SQL with sqlx::AssertSqlSafe(). Hex decoding for binary identifiers removes .as_ref() usage while maintaining slice boundaries.
PostgreSQL connector SQLx safety wrapping
src/database/impls/database_connector_pgsql.rs
Table creation and CRUD operations wrap dynamic SQL with sqlx::AssertSqlSafe(). Torrent/whitelist/blacklist/key loading extracts binary column bytes directly to [u8; 20] or decodes hex strings; user loading reads UUID/numeric IDs as String/i64 before SHA1 hashing, replacing raw byte slice decoding.
SQLite connector SQLx safety wrapping
src/database/impls/database_connector_sqlite.rs
All bootstrapping and data access paths wrap dynamic SQL with sqlx::AssertSqlSafe() instead of raw sqlx::query() calls. Hex-decoding logic removes .as_ref() in torrent/whitelist/blacklist/key loading.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Power2All/torrust-actix#77: Both PRs update PostgreSQL database connector table creation; main PR wraps SQL with sqlx::AssertSqlSafe() while the retrieved PR removes async_std task dependency and eliminates sleep/restart behavior.

Poem

🐰 SQLx rises to the call,
Safety wrapping encompasses all,
From MySQL's depths to Postgres high,
SQLite joins the version sky,
Four-two-eleven hops along! 🏃‍♂️

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'v4.2.11' is vague and generic, using only a version number without describing the actual changes or improvements in the changeset. Consider using a more descriptive title such as 'Release v4.2.11: Upgrade SQLx and fix PostgreSQL database implementation' to clearly convey the main changes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v4.2.11

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Power2All Power2All merged commit 6a227a4 into master May 25, 2026
2 checks passed
@Power2All Power2All deleted the v4.2.11 branch May 25, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant