-
Notifications
You must be signed in to change notification settings - Fork 65
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
Integrate bal persist
generate to the bal build
#5784
Comments
According to the new tool integration support, there are a few changes we need to make in the If the datastore is
In order to maintain backward compatibility, we do need to support both config formats in the
|
Based on the discussion, we need to focus on two use cases when designing the bal build integration,
We need to identify the use case when initializing the bal persist init --datastore mysql --module db --integrate-build false This will generate [persist]
datastore = "mysql"
module = "hospitalsvc.db" This will generate the client in a submodule called Additional param [tool.persist]
id = "generate-db-client"
filePath = "persist/model.bal" // required field
targetModule = "db"
options.datastore = "mysql" |
@sameerajayasoma Please review and share your thoughts on the latest design |
Possible Scenarios and Proposed Approach
|
As you've described, there are two distinct use cases.
Both scenarios have pros and cons and depend on a particular project's requirements. We need to support both. This is my proposal to improve
I think we can model the
|
FYI, my proposal introduces breaking changes. If the design is right, I don't think we should delay introducing these changes. The current design has several loopholes. Btw, the above proposal does not address the creation of the
|
The
|
For migrating existing projects
|
@sameerajayasoma Please share your thoughts on migration plan |
LGTM |
For any project that is migrating to Update 9, everything will work as usual. Only when you try to re-generate code using |
Yes, correct. The above message will only print until he/she cleans up the old configs in Ballerina. |
This is done. Hence closing the issue |
Description:
We need to integrate the
bal persist
generate to thebal build
command as nowbal build
supports integrating external tools to the bal build so that it will generate the necessary source code in the pre-compile stage.Lang Changes are available at: /~https://github.com/ballerina-platform/ballerina-lang/tree/new-tool-build-integration
You can use the following samples to get started.
/~https://github.com/Dilhasha/sample-build-tool-runner
/~https://github.com/ShammiL/sample-build-tool
The text was updated successfully, but these errors were encountered: