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

Modernization Business PL/SQL #80

Closed
phodal opened this issue Jan 22, 2024 · 0 comments
Closed

Modernization Business PL/SQL #80

phodal opened this issue Jan 22, 2024 · 0 comments

Comments

@phodal
Copy link
Member

phodal commented Jan 22, 2024

No description provided.

phodal added a commit that referenced this issue Jan 22, 2024
This commit adds new PL/SQL migration actions to the database module. The actions include generating Java unit tests, generating Java entities, and visualizing PL/SQL code. The commit also includes the necessary changes to the AutoDevBundle properties file to support the new actions.
phodal added a commit that referenced this issue Jan 22, 2024
…or design #80

Add a new file `ModularDesignAction.kt` in the `cc.unitmesh.database.actions` package. This class extends `AbstractChatIntention` and provides implementation for various methods. It is not yet implemented.

Modify the `cc.unitmesh.database.xml` file to include the `ModularDesignAction` class in the `autoDevIntention` section.

Modify the `AutoDevBundle.properties` file to include a new message key `migration.database.plsql.modular.design` with the value "Modular Code".

Modify the `VisualSqlAction.kt` file to extend `AbstractChatIntention` instead of `IntentionAction`. The `priority` method is overridden to return 1001. The `isAvailable` and `invoke` methods are not yet implemented.
phodal added a commit that referenced this issue Jan 24, 2024
This commit adds the `DbContext` and `DbContextProvider` classes to the `GenSqlScriptBySelection.kt` file in the `exts/database/src/main/kotlin/cc/unitmesh/database/actions/` directory.

The `DbContext` class is a data class that holds information about the database version, schema name, and table names.

The `DbContextProvider` class is responsible for retrieving the columns of specified tables. It has a `getTableColumns` function that takes a list of table names and returns a list of column names from those tables.
phodal added a commit that referenced this issue Jan 24, 2024
This commit adds two new SQL generation templates for the Database Administrator. The first template, `sql-gen-clarify.vm`, prompts the user to choose the best tables based on their requirements. The second template, `sql-gen-design.vm`, prompts the user to write SQL queries based on their requirements and table information. Both templates provide clear instructions and examples to guide the user.
phodal added a commit that referenced this issue Jan 24, 2024
Add a prompter to generate SQL script based on user selection. The prompter uses a template to render the SQL script and includes custom actions. The prompter is displayed in the chat window for the user to interact with.
phodal added a commit that referenced this issue Jan 24, 2024
This commit adds functionality to generate SQL scripts based on selected tables. It introduces new classes and methods to handle the SQL generation process. The `GenSqlScriptBySelection` class now includes a `generateSqlWorkflow` method that runs the SQL generation process in the background. It also introduces the `GenSqlFlow` class, which handles the step-by-step process of generating SQL scripts. The `clarify` method prompts the user to clarify the requirements, while the `generate` method generates the SQL script based on the clarified requirements and selected tables. This new functionality enhances the database migration capabilities of the application.
phodal added a commit that referenced this issue Jan 24, 2024
- Refactored the getTableColumns method in GenSqlScriptBySelection.kt to use mapNotNull instead of flatMap for better performance.
- Added logging to display the table name and its corresponding columns for better debugging and understanding.
phodal added a commit that referenced this issue Jan 24, 2024
- Clarify a typo in the AutoDevBundle.properties file.
- Import the LLMCoroutineScope class for coroutines.
- Use BackgroundableProcessIndicator for progress indicator.
- Add kotlinx.coroutines.launch for coroutines.
- Refactor the generateSqlWorkflow function for readability.
- Add project parameter to GenSqlFlow class.
- Remove unnecessary try-catch blocks in GenSqlFlow.
- Join columns with a comma in the generate function.
- Use EditorEx instead of Editor in CodeBlockView.
phodal added a commit that referenced this issue Jan 24, 2024
Add code parsing functionality to the GenSqlScriptBySelection.kt file in the database module. This allows for parsing and inserting the SQL script into the editor.
phodal added a commit that referenced this issue Jan 24, 2024
Add a check to ensure that the list of table names is not empty before generating the SQL script. If the list is empty, set the progress indicator fraction to 1.0 and log a warning message. Also, add a new function `getAllTables()` to retrieve all table names from `actions.dasTables`.
phodal added a commit that referenced this issue Jan 24, 2024
This commit adds the `DbContextActionProvider` class, which retrieves the columns of specified tables. It includes a `getTableColumns` function that takes a list of table names and returns a list of column names from those tables. The implementation uses the `DasUtil.getColumns` method to retrieve the columns and formats them as "TableName: ColumnName: DataType". This class is added to the `database` package in both the `222` and `233` directories. Additionally, the `GenSqlScriptBySelection.kt` file is modified to import and use the `DbContextActionProvider` class.
phodal added a commit that referenced this issue Jan 24, 2024
This commit renames the `GenFlowContext` class to `GenSqlContext` in order to provide a more accurate and descriptive name for the class. The class represents the context for generating SQL scripts and contains properties such as requirement, database version, schema name, table names, and table information. The renaming improves code readability and maintainability.
@phodal phodal closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant