Skip to content

Conversation

@sauramel
Copy link

Add Complete MySQL/MariaDB Support

Summary

  • Introduced methods for inserting, updating, and deleting rows in the MySQLManager class.
  • Updated connection handling to store original configuration and track readonly connections.
  • Improved error handling for database operations to ensure proper connection checks.
  • Adjusted SQL queries to use qualified table names based on the current database context.
  • Modified default database selection in DatabaseConnection component for MySQL connections.

Description

This PR implements complete MySQL/MariaDB support for DataPup, bringing the database client to feature parity with existing ClickHouse and PostgreSQL implementations. The MySQL manager now includes all required CRUD operations, proper connection management, schema introspection, and transaction support. Users can now connect to MySQL/MariaDB databases and perform all standard database operations including querying, inserting, updating, and deleting data.

Type of Change

Please mark the relevant option(s):

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • �� UI/UX improvement
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • ✅ Test update
  • 🔧 Configuration change

Related Issues

Fixes # (MySQL/MariaDB support implementation)

Screenshots/Recordings

Before

MySQL was listed as "Coming Soon" in documentation and had incomplete implementation

After

MySQL now appears in supported database types and connects successfully

Testing

Please confirm the following:

  • I have tested these changes locally
  • I have added/updated tests for these changes (if applicable)
  • All existing tests pass
  • I have tested on different screen sizes (if UI changes)
  • I have tested with different themes (if UI changes)

Test Instructions

  1. Start the application with npm run dev
  2. Navigate to the database connection screen
  3. Select "MySQL" as the database type
  4. Enter valid MySQL/MariaDB connection details (host, port, database, username, password)
  5. Test the connection - it should connect successfully
  6. Execute a simple query like SELECT 1 to verify query execution
  7. Test CRUD operations by creating, reading, updating, and deleting test data
  8. Verify schema introspection by exploring tables and columns
  9. Test transaction support with BEGIN/COMMIT/ROLLBACK operations

Additional Notes

This PR completes the MySQL/MariaDB implementation that was previously marked as "coming soon" in the project documentation. The implementation follows the same architectural patterns as the existing ClickHouse and PostgreSQL managers, ensuring consistency and maintainability. All methods now return proper TypeScript interface types instead of any, improving type safety throughout the codebase.

The changes include:

  • Complete CRUD operation implementation in MySQLManager
  • Proper connection configuration storage and retrieval
  • Database-qualified table names for all operations
  • Readonly connection tracking
  • Frontend default database value fix for MySQL connections

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

- Introduced methods for inserting, updating, and deleting rows in the MySQLManager class.
- Updated connection handling to store original configuration and track readonly connections.
- Improved error handling for database operations to ensure proper connection checks.
- Adjusted SQL queries to use qualified table names based on the current database context.
- Modified default database selection in DatabaseConnection component for MySQL connections.
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