Skip to content

feat: separate mysql and mariadb#49

Merged
RambokDev merged 2 commits intomainfrom
feat/separate-mysql-mariadb
Mar 29, 2026
Merged

feat: separate mysql and mariadb#49
RambokDev merged 2 commits intomainfrom
feat/separate-mysql-mariadb

Conversation

@RambokDev
Copy link
Copy Markdown
Contributor

@RambokDev RambokDev commented Mar 29, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added MariaDB as a distinct database type with full backup, restore, and connection testing capabilities.
  • Chores

    • Updated Docker Compose configuration to include MariaDB and MySQL services for local development and testing.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: de38a3b9-e636-40dd-94b8-18d122044ed5

📥 Commits

Reviewing files that changed from the base of the PR and between 8bf6503 and 254253d.

📒 Files selected for processing (14)
  • databases.json
  • docker-compose.yml
  • docker/Dockerfile
  • src/domain/factory.rs
  • src/domain/mariadb/backup.rs
  • src/domain/mariadb/connection.rs
  • src/domain/mariadb/database.rs
  • src/domain/mariadb/mod.rs
  • src/domain/mariadb/ping.rs
  • src/domain/mariadb/restore.rs
  • src/domain/mod.rs
  • src/domain/mysql/backup.rs
  • src/domain/mysql/ping.rs
  • src/services/config.rs

📝 Walkthrough

Walkthrough

This PR introduces native MariaDB support as a distinct database backend type, implementing a complete MariaDB module with backup/restore/ping capabilities, updating the factory pattern to instantiate MariaDBDatabase for the Mariadb DbType, and configuring Docker infrastructure with separate MariaDB and MySQL instances.

Changes

Cohort / File(s) Summary
Infrastructure Configuration
databases.json, docker-compose.yml, docker/Dockerfile
Updated test database configurations with new MariaDB and MySQL entries; replaced PostgreSQL and Redis/Valkey services with dedicated db-mariadb (port 3311) and db-mysql (port 3312) services; removed Docker socket bind mount from rust-app; added blank line in Dockerfile.
MariaDB Domain Module
src/domain/mariadb/mod.rs, src/domain/mariadb/database.rs, src/domain/mariadb/backup.rs, src/domain/mariadb/restore.rs, src/domain/mariadb/connection.rs, src/domain/mariadb/ping.rs
New MariaDB backend module implementing Database trait with backup/restore operations using mariadb-dump and mariadb CLI; includes server version detection and binary path selection for different MariaDB versions; backup uses transactional/safe dump flags with compression; restore drops and recreates database then pipes SQL content.
Factory & Type System
src/domain/factory.rs, src/domain/mod.rs, src/services/config.rs
Updated DatabaseFactory to instantiate MariaDBDatabase for DbType::Mariadb; registered new mariadb domain module; changed DbType::as_str() to return "mariadb" for Mariadb variant instead of "mysql".
MySQL Adapter Updates
src/domain/mysql/backup.rs, src/domain/mysql/ping.rs
Added debug/info logging for backup stderr/stdout output; changed ping to invoke mariadb-admin instead of mysqladmin; added (commented) version-based binary selection logic.

Possibly Related PRs

  • feat: add-redis #39: Modifies src/domain/factory.rs and src/services/config.rs for database backend support, overlapping with this PR's type system changes.
  • feat: add-valkey #43: Adds Valkey as a new database backend to DatabaseFactory following the same pattern as this PR's MariaDB implementation.
  • fix: tests #47: Implements MariaDB support with related test modules and testcontainer features complementing this PR's MariaDB domain code.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A MariaDB burrow, fresh and new,
With backups swift and restores true,
The factory knows which path to choose,
While docker spins its MySQL blues—
Hop along, dear databases, in the finest tune! 🥕

✨ 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 feat/separate-mysql-mariadb

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.

@RambokDev RambokDev merged commit d4abcbc into main Mar 29, 2026
1 of 2 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 29, 2026

Codecov Report

❌ Patch coverage is 90.96045% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/domain/mariadb/backup.rs 89.36% 5 Missing ⚠️
src/domain/mariadb/restore.rs 91.37% 5 Missing ⚠️
src/domain/mariadb/connection.rs 90.62% 3 Missing ⚠️
src/domain/mariadb/ping.rs 94.11% 1 Missing ⚠️
src/domain/mysql/backup.rs 50.00% 1 Missing ⚠️
src/services/config.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai bot mentioned this pull request Mar 30, 2026
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.

1 participant