Skip to content

Conversation

@mustansir14
Copy link
Contributor

@mustansir14 mustansir14 commented Dec 17, 2025

Description:

This PR serves as an extension of #4574 by further refactoring the detector to unify code across JDBC's detector and analyzer.
Changes here will make better sense when viewed in conjunction with the corresponding analyzer PR.

Instead of publicizing seperate methods like parseMySQL and buildMySQLConnectionString, I've now added methods like GetConnectionInfo, GetDBType and BuildConnectionString to the existing JDBC interface, so that both the detector and analyzer can directly use the NewJDBC method and then call the methods they need.

Tests for parsing and building connection strings have been moved from the analyzer to the detector as well.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@mustansir14 mustansir14 requested a review from a team December 17, 2025 07:37
@mustansir14 mustansir14 requested a review from a team as a code owner December 17, 2025 07:37
Copy link
Contributor

@amanfcp amanfcp left a comment

Choose a reason for hiding this comment

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

This is cool! Thanks Mustansir

Now you've encapsulated all the methods and export only NewJDBC which is leaner approach.

I can't think of any reason for JDBC analyzer to use individual methods so we're good

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.

2 participants