Fix conversion issues with Gemini assistance

Database Migration Service integrates Gemini into the conversion workspaces. Gemini analyzes your fixes to SQL objects and suggests other changes based on your input. Your SQL code and schema are stored in the region where you create the conversion workspace. If you use assisted code and schema conversion with Gemini, your code and schemas might be processed in other regions.

Gemini doesn't use your prompts or its responses as data to train its models. For more information, see How Gemini for Google Cloud uses your data.

After you apply fixes to several SQL objects, Gemini suggests changes to other objects based on your code edits. In this way, you can propagate your fixes to multiple objects without making all edits manually.

Before you begin

To use Gemini suggestions in Database Migration Service conversion workspaces, you need to enable Gemini for your project. See set up Gemini in Databases for more information.

After you enable Gemini for your project, Gemini suggestions are enabled for all your conversion workspaces. You can later disable the suggestions in a specific workspace.

View Gemini suggestions in Database Migration Service

When you fix object issues by editing the SQL object's code, Gemini analyzes your changes. After enough changes are made, Gemini displays a prompt and suggests further edits.

To access Gemini suggestions:

  1. In the Google Cloud console, go to Conversion workspaces.

    Go to Conversion workspaces

  2. From the list of available conversion workspaces, select the conversion workspace that you want to work with.

    The conversion workspace editor opens.

  3. In the Oracle panel, select the object whose generated SQL you want to adjust

  4. Fix conversion issues that you encounter with the object and save code changes.

    Gemini analyzes your most recent fixes until it can suggest similar updates to other objects with conversion issues. When Gemini has analyzed enough of your fixes, the Review suggestions from Gemini dialog is displayed.

    Gemini fix issues dialog.
    Figure 1. Gemini fix issues dialog. (click to enlarge)
    Gemini fix issues dialog.
  5. To view AI-generated suggestions that are based on the changes you made, click Review suggestions.

Review Gemini suggestions

The Fix issues with Gemini page displays suggestions generated by Gemini based on the code changes that you have made. These suggestions contain similar changes that you can apply to other objects. For every suggestion, you can review, change, accept, or ignore the suggestion.

The Fix issues with Gemini page displays three variants of an object's source code, which you can select in the Edit view menu:

  • Original source code (read-only)
  • Draft destination source code (read-only)
  • Destination source code generated by Gemini (editable)

The Objects pane contains a list of objects that have issues and fixes suggested by Gemini.

To review Gemini suggestions, follow these steps:

  1. Click an object to display the related AI-suggested fix.
  2. Review and edit the code that Gemini suggested.
  3. Do one of the following:

    • To accept the suggestion (including your edits), click Accept code. The changes are applied to the object in the conversion workspace, and the object state in the objects list changes from Pending to Accepted.

    • To keep the suggestion (including your edits) without applying the changes, switch to a different object. The object remains in the Pending state. You can edit the code and accept or ignore the suggestion later.

    • To ignore pending or accepted suggestions (and revert your edits), click Ignore code. The object state in the objects list changes from Pending to Ignored. Your changes are reverted. You can edit the code and apply it later.

To close Gemini suggestions and discard all changes that you haven't applied, follow these steps:

  1. On the Fix issues with Gemini page, click the back arrow.
  2. In the Close Gemini dialog, click Close.

    The current Gemini session is closed. To go back to the suggestions page, access Gemini suggestions again.

Disable Gemini suggestions

By default, Gemini suggestions are enabled for your conversion workspaces after you enable Gemini for your project. You can disable Gemini suggestions in a specific conversion workspace. To disable Gemini code fix suggestions, perform the following steps:

  1. In the Google Cloud console, go to Conversion workspaces.

    Go to Conversion workspaces

  2. From the list of available conversion workspaces, select the conversion workspace that you want to work with.

    The conversion workspace editor opens.

  3. In the taskbar, click pen_spark Gemini and select Code suggestion.

Gemini is now disabled for this conversion workspace.

What's next