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

Introspection Support for Bal Persist #330

Merged
merged 54 commits into from
Mar 14, 2024

Conversation

hasathcharu
Copy link
Contributor

@hasathcharu hasathcharu commented Feb 27, 2024

Purpose

To add introspection support to the bal persist module. This introduces a new command bal persist pull that will introspect existing SQL databases, generate the data model and write it to the persist/model.bal file.

Fixes: ballerina-platform/ballerina-library/issues/6014

Checklist

  • Linked to an issue
  • Updated the specification
  • Updated the changelog
  • Added tests

@hasathcharu hasathcharu force-pushed the rebased branch 2 times, most recently from 65c5f05 to 2e9e825 Compare March 1, 2024 08:30
docs/spec/spec.md Outdated Show resolved Hide resolved
hasathcharu and others added 23 commits March 5, 2024 11:46
…VarChar and Char length, Decimal precision and scale fields
…rrectly due to the order in which the entities are organized
}

public Module introspectDatabase() throws SQLException {
ScriptRunner sr = new ScriptRunner(connection);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we close this connection explicitly? Better to have it in a try block for proper resource management.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The connection is instantiated in a try block in Pull.java

Copy link

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.98%. Comparing base (ec3d528) to head (f93f643).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #330      +/-   ##
==========================================
+ Coverage   82.43%   82.98%   +0.54%     
==========================================
  Files          45       61      +16     
  Lines        3992     5241    +1249     
  Branches      513      665     +152     
==========================================
+ Hits         3291     4349    +1058     
- Misses        531      675     +144     
- Partials      170      217      +47     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Quality Gate Passed Quality Gate passed

Issues
33 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
2.1% Duplication on New Code

See analysis details on SonarCloud

@daneshk daneshk merged commit 613d402 into ballerina-platform:main Mar 14, 2024
6 checks passed
@hasathcharu hasathcharu deleted the rebased branch March 14, 2024 05:30
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.

Add MySQL database introspection support (POC) to persist-tools module.
5 participants