Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate from MySQL C API to MySQL X DevAPI #2704

Open
wants to merge 56 commits into
base: main
Choose a base branch
from

Conversation

dudantas
Copy link
Member

@dudantas dudantas commented Jun 20, 2024

This pull request encompasses the migration from the traditional MySQL C API to the modern MySQL X DevAPI across our project. This change introduces enhanced robustness, improved code readability, and leverages the modern features of MySQL X DevAPI.

Key Changes:

• Replaced all instances of MySQL C API function calls with their MySQL X DevAPI equivalents.
• Refactored database interaction logic to utilize the fluent API provided by MySQL X DevAPI, ensuring more maintainable and clearer code.
• Implemented error handling and data type conversions using MySQL X DevAPI's robust mechanisms, enhancing stability and performance.
• Updated corresponding documentation and comments to reflect changes in the database access layer.

This update paves the way for future database interactions to be more flexible and easier to manage.

To test on Windows, you need to install the official MySQL and preferably the latest Nginx and PHP using Chocolatey.

Important: in mysqlx, the port used is 33060

@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 4c32d4a to c8fa521 Compare June 20, 2024 05:58
@kaleohanopahala

This comment was marked as off-topic.

@W4gNII

This comment was marked as off-topic.

@dudantas dudantas marked this pull request as draft June 22, 2024 19:37
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch 3 times, most recently from 5ff30f7 to b7c2dc0 Compare June 24, 2024 01:09
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch 2 times, most recently from a1ff09d to 9c9324f Compare June 28, 2024 19:08
This pull request encompasses the migration from the traditional MySQL C API to the modern MySQL X DevAPI across our project. This change introduces enhanced robustness, improved code readability, and leverages the modern features of MySQL X DevAPI.

Key Changes:

• Replaced all instances of MySQL C API function calls with their MySQL X DevAPI equivalents.
• Refactored database interaction logic to utilize the fluent API provided by MySQL X DevAPI, ensuring more maintainable and clearer code.
• Implemented error handling and data type conversions using MySQL X DevAPI's robust mechanisms, enhancing stability and performance.
• Updated corresponding documentation and comments to reflect changes in the database access layer.

This update paves the way for future database interactions to be more flexible and easier to manage.

To test on Windows, you need to install the official MySQL and preferably the latest Nginx and PHP using Chocolatey.
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 9c9324f to 82a8d1a Compare June 28, 2024 19:13
@dudantas dudantas changed the title improve: add database caching feat: migrate from MySQL C API to MySQL X DevAPI Jun 28, 2024
@dudantas

This comment was marked as outdated.

@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 0d8d820 to c182e31 Compare July 1, 2024 01:23
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 458e0e3 to e20497f Compare July 1, 2024 02:23
This commit introduces several key improvements to the PropStream and DBResult classes to enhance maintainability, type safety, and performance:

1. Encapsulation of Template Functions: Moved template function implementations from header files to .cpp files. This change reduces compilation dependencies and improves compile times by minimizing recompilation needs when templates are modified.

2. Specialized Read Functions: Replaced generic template read functions with type-specific methods such as readU8, readU16, etc. This approach enhances type safety, allowing for stricter type checks and reducing runtime errors.

3. Vector Instead of Raw Pointers: Replaced raw pointer parameters with std::vector<uint8_t> in PropStream's handling of binary data. This change increases safety by leveraging C++ container management features, avoiding manual memory management and potential data corruption issues.

These changes are aimed at making the codebase more robust, easier to manage, and less prone to errors, particularly in the handling of binary data and type conversions.
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from ca48774 to ff4623d Compare July 1, 2024 19:54
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 7f6a8db to ca11a21 Compare July 2, 2024 15:27
@dudantas dudantas marked this pull request as ready for review July 2, 2024 15:28
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from e10d38e to 1ede20d Compare July 3, 2024 03:12
tests/build_and_run.sh Outdated Show resolved Hide resolved
tests/build_and_run.sh Outdated Show resolved Hide resolved
tests/build_and_run.sh Outdated Show resolved Hide resolved
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 48b282e to 58b37e4 Compare October 12, 2024 19:31
@dudantas dudantas force-pushed the dudantas/improve-add-database-caching branch from 738d7f5 to be30946 Compare October 15, 2024 05:27
Copy link

Copy link
Contributor

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale No activity label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale No activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants