Skip to content

fix: database and database usernames quoted to support hyphens in value - #1270

Merged
saeedvaziry merged 1 commit into
vitodeploy:4.xfrom
shawnhooper:unquoted-db-name
Oct 7, 2026
Merged

saeedvaziry merged 1 commit into
vitodeploy:4.xfrom
shawnhooper:unquoted-db-name

Conversation

@shawnhooper

@shawnhooper shawnhooper commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes issue #1250

Quotes the database name in order to support characters like a hyphen in the name.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of MariaDB and MySQL database names containing hyphens when creating, deleting, or linking databases.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: vitodeploy/vito/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d7d9a82c-6a43-4d33-9af4-1bc40fcd2a41
📥 Commits

Reviewing files that changed from the base of the PR and between 8a545bf and c8580ac.

📒 Files selected for processing (8)
  • resources/views/ssh/services/database/mariadb/create.blade.php
  • resources/views/ssh/services/database/mariadb/delete.blade.php
  • resources/views/ssh/services/database/mariadb/link.blade.php
  • resources/views/ssh/services/database/mysql/create.blade.php
  • resources/views/ssh/services/database/mysql/delete.blade.php
  • resources/views/ssh/services/database/mysql/link.blade.php
  • tests/Feature/DatabaseTest.php
  • tests/Feature/DatabaseUserTest.php

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

MariaDB and MySQL database commands now quote database names with backticks. Feature tests cover creating, deleting, and linking a database named my-database.

Changes

Database identifier quoting

Layer / File(s) Summary
Quote database names and verify operations
resources/views/ssh/services/database/mariadb/*, resources/views/ssh/services/database/mysql/*, tests/Feature/DatabaseTest.php, tests/Feature/DatabaseUserTest.php
Create, delete, and privilege commands quote database names. Feature tests check operations with a hyphenated name and verify the generated commands.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: saeedvaziry

Merge Risk: ⚪ Minimal · up to c8580

The intended hyphenated database-name behavior is covered, with no merge-blocking regression established.

Architecture Summary

Architecture risk: 🔵 Low · up to c8580

The change affects 2 systems.

Changed systems: resources, tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — resources (service) was modified; 6 changed files map to changed impact.
  • observed — tests (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in resources/views/ssh/services/database/mariadb/create.blade.php: The database name is now quoted with backticks in the CREATE DATABASE statement; the existing failure handling is unchanged.
  • observed — Modified behavior in resources/views/ssh/services/database/mariadb/delete.blade.php: The DROP DATABASE command now quotes the interpolated database name with backticks; the previous command interpolated it without quoting.
  • observed — Modified behavior in resources/views/ssh/services/database/mariadb/link.blade.php: The REVOKE and GRANT statements now quote the database name with backticks; the existing revoke-error handling and grant-failure handling are unchanged.
  • observed — Modified behavior in resources/views/ssh/services/database/mysql/create.blade.php: The database name is now enclosed in escaped backticks in the CREATE DATABASE command.
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes quoting database names, which matches the change, but it also claims that database usernames are quoted. The changeset does not include that change, so the title is misleading. Rename the pull request to reflect the changeset, for example: "fix: quote database names to support hyphens".
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@shawnhooper
shawnhooper marked this pull request as ready for review October 4, 2026 21:01
@RichardAnderson
RichardAnderson requested a balanced review from Copilot October 7, 2026 17:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused quoting changes have no identified blocking issues, and shell verification supports correctness; project tests were not run.

0 open findings

What changed in this PR

Fixes #1250 by quoting database identifiers in MySQL and MariaDB SSH scripts so hyphenated names work correctly.

Changes:

  • Adds shell-escaped backticks for database creation, deletion, and privilege updates.
  • Adds MySQL regression tests for creating, deleting, and linking hyphenated databases.
File Description
tests/​Feature/​DatabaseUserTest.php Tests linking a hyphenated database.
tests/​Feature/​DatabaseTest.php Tests hyphenated database creation and deletion.
resources/​views/​ssh/​services/​database/​mysql/​link.blade.php Quotes identifiers in privilege updates.
resources/​views/​ssh/​services/​database/​mysql/​delete.blade.php Quotes identifiers when dropping databases.
resources/​views/​ssh/​services/​database/​mysql/​create.blade.php Quotes identifiers when creating databases.
resources/​views/​ssh/​services/​database/​mariadb/​link.blade.php Quotes identifiers in privilege updates.
resources/​views/​ssh/​services/​database/​mariadb/​delete.blade.php Quotes identifiers when dropping databases.
resources/​views/​ssh/​services/​database/​mariadb/​create.blade.php Quotes identifiers when creating databases.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@RichardAnderson

Copy link
Copy Markdown
Member

Already allowed in Postgresql, so no updates required for those scripts. Looks like a solid improvement.

@saeedvaziry
saeedvaziry merged commit 8598e4d into vitodeploy:4.x Oct 7, 2026
4 of 6 checks 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.

4 participants