Skip to content
New issue

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

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

Already on GitHub? # to your account

Refactor Relational Source and add MySQL Support #146

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amansinghoriginal
Copy link
Contributor

@amansinghoriginal amansinghoriginal commented Jan 26, 2025

Description

  • Add support for MySQL source using embedded Debezium engine.
  • Add source provider for MySQL to the list of default providers loaded by the CLI during installation.
  • Refactor Relational Source code to make it easier to support other relational databases.

Type of change

  • This pull request fixes a bug in Drasi and has an approved issue (issue link required).
  • This pull request adds or changes features of Drasi and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Drasi (issue link optional).

Fixes: #145

Refactoring from the existing architecture:
Simplified_UML_Diagram_3

To this for easier extensibility:
Simplified_UML_Diagram

@amansinghoriginal amansinghoriginal marked this pull request as ready for review January 27, 2025 17:21
@amansinghoriginal amansinghoriginal requested a review from a team as a code owner January 27, 2025 17:21
public static void main(String[] args) {

log.info("Starting SQL Proxy for {}", SourceProxy.SourceId());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bring it back.

Reactivator.TerminalError(new IllegalArgumentException("Database host is required."));

var dbPassword = Reactivator.GetConfigValue("password");
if (dbPassword == null || dbPassword.isEmpty())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Daniel: Make it optional

if (dbPort == null || dbPort.isEmpty())
Reactivator.TerminalError(new IllegalArgumentException("Database port is required."));

var dbUser = Reactivator.GetConfigValue("user");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Daniel: Make it optional

// Port of the database server.
.with("database.port", dbPort)
// Username to be used when connecting to the database server.
.with("database.user", dbUser)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Daniel: Can we add trustServerCertificate

Copy link
Contributor

Choose a reason for hiding this comment

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

trustServerCertificate is specific to the SQL Server JDBC driver

config_schema:
type: object
properties:
connector:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add an enum field for this property that contains a list of valid connectors, that way the error will be caught when we do drasi apply with an invalid connector

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

This one is kind of hard coded per source type. We aren't documenting it and we don't want to user to actually change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense. Thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Adding MySQL sources in Drasi
3 participants