# Update source code of database objects

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/go/2026.3/llms.txt).

In GoLand, you can update the source code of a database object directly in its DDL `CREATE` script. The IDE will generate a migration script for you to review and submit to the database.

> **Note:**
> Tables are not objects that have stored source code. The most common objects found with the source code are views, functions, and stored procedures.

## Update a single database object

### Step 1. Load source code

GoLand retrieves the source code of database objects during the  [introspection](glossary-database-tools-and-sql.html#introspection) of a data source. The retrieved source code can be modified and submitted back to the database.

Procedure:

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (VSCode), `Shift+Enter` (VSCode (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com/help/img/idea/2026.3/open_data_sources_and_drivers_dialog.png)

2. Right-click the data source for which you want to download source code and select `Load Sources | Except System Schemas`.

![Load source code for a data source](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_load_source_code.png)

3. Click OK.

### Step 2. Make the changes

To make the required changes in the source code of an object, open and edit its DDL `CREATE` script directly in the DDL editor.

Procedure:

1. In the   Database   tool window , right-click the object and select `Navigation | Go to DDL`. Alternatively, press `Ctrl+B` (Windows), `⌘ B` (macOS), `⌘ B` (IntelliJ IDEA Classic (macOS)), `⌘ B` (macOS System Shortcuts), `Ctrl+B` (XWin), `Ctrl+B` (GNOME), `Ctrl+B` (KDE), `Ctrl+Alt+G` (Emacs), `F12` (Sublime Text), `F12` (Sublime Text (macOS)), `F12` (VSCode), `F12` (VSCode (macOS)).

2. In the DDL `CREATE` script that opens in DDL editor, make the required changes.

> **Note:**
> The object references in the generated script are not qualified (for example, `<view_name>` instead of `<schema_name>.<view_name>`). You can view this script, edit it, and submit your changes to the database.
>
>
>
> For a runnable DDL script that includes `CREATE OR REPLACE`, qualified references, and so on, use the [SQL Generator](export-data.html#generate-ddl-definitions-for-dat).

![Changes in the source code](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_source_code_changes.png)

> **Tip:**
> Click the change marker in the gutter to see the previous contents of the modified line.
>
>
>
> For more information about seeing the differences between modified and stored versions, refer to [Modify source code](modifying-source-code-of-database-objects.html#see-the-diff-between-modified-and-stored-versions).

The object can be updated from a third-party location, in this case the cached object would differ from the source code of the same object in the database. For more information about it, refer to [Outdated cached objects](modifying-source-code-of-database-objects.html#outdated-cached-objects).

### Step 3. Submit the changes

Submit the changes that you made in source code of database object to the database.

Procedure:

1. By default, the migration script preview for a valid script is not shown in the Object Migration dialog upon submitting. Make sure that it appears at this step. Otherwise, the valid migration script will be executed silently.

Open IDE settings by pressing `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)), navigate to `Database | Other | Refactoring`, and ensure that the Show preview of valid script when updating source text checkbox is selected.

2. In the DDL editor, click the Submit icon (![the Submit button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.submitDB.svg)) on the toolbar.

3. In the Object Migration dialog that opens, verify that the migration script is correct.

GoLand can automatically generate a migration script, but you must check it before running.

![Migration script with changes for a single database object](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_migration_script.png)

4. Click OK to execute the script.

In case you need to apply more complex changes, GoLand will generate a corresponding migration script with, for example, `DROP` and `CREATE` included.

![Migration script with changes for a single database object](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_migration_script_complex.png)

## Update multiple database objects

### Step 1. Load source code

GoLand retrieves the source code of database objects during the  [introspection](glossary-database-tools-and-sql.html#introspection) of a data source. The retrieved source code can be modified and submitted back to the database.

Procedure:

1. Open data source properties by doing one of the following:

* On the Database tool window toolbar, click ![The Data Sources icon](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.manageDataSources.svg) Data Sources.

* Press `Shift+Enter` (Windows), `⌘ I` (macOS), `⇧ ⏎` (IntelliJ IDEA Classic (macOS)), `⌘ I` (macOS System Shortcuts), `Shift+Enter` (XWin), `Shift+Enter` (GNOME), `Shift+Enter` (KDE), `Shift+Enter` (Emacs), `Shift+Enter` (Sublime Text), `⌘ I` (Sublime Text (macOS)), `Shift+Enter` (VSCode), `Shift+Enter` (VSCode (macOS)) .

![Open the Data Source and Drivers dialog](https://resources.jetbrains.com/help/img/idea/2026.3/open_data_sources_and_drivers_dialog.png)

2. Right-click the data source for which you want to download source code and select `Load Sources | Except System Schemas`.

![Load source code for a data source](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_load_source_code.png)

3. Click OK.

### Step 2. Make the changes in DDL scripts of multiple objects

To make the required changes in source code of database objects, open and edit their DDL `CREATE` scripts directly in the DDL editor.

Procedure:

1. In the   Database   tool window , select the objects, right-click them, and navigate to `Navigation | Go to DDL`. Alternatively, press `Ctrl+B` (Windows), `⌘ B` (macOS), `⌘ B` (IntelliJ IDEA Classic (macOS)), `⌘ B` (macOS System Shortcuts), `Ctrl+B` (XWin), `Ctrl+B` (GNOME), `Ctrl+B` (KDE), `Ctrl+Alt+G` (Emacs), `F12` (Sublime Text), `F12` (Sublime Text (macOS)), `F12` (VSCode), `F12` (VSCode (macOS)).

2. In the DDL `CREATE` scripts that open in DDL editor for each object, make the required changes.

> **Note:**
> The object references in the generated script are not qualified (for example, `<view_name>` instead of `<schema_name>.<view_name>`). You can view this script, edit it, and submit your changes to the database.
>
>
>
> For a runnable DDL script that includes `CREATE OR REPLACE`, qualified references, and so on, use the [SQL Generator](export-data.html#generate-ddl-definitions-for-dat).

![Changes in the source code of multiple objects](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_source_code_changes_in_multiple_objects.png)

> **Tip:**
> Click the change marker in the gutter to see the previous contents of the modified line.
>
>
>
> For more information about seeing the differences between modified and stored versions, refer to [Modify source code](modifying-source-code-of-database-objects.html#see-the-diff-between-modified-and-stored-versions).

The object can be updated from a third-party location, in this case the cached object would differ from the source code of the same object in the database. For more information about it, refer to [Outdated cached objects](modifying-source-code-of-database-objects.html#outdated-cached-objects).

### Step 3. Observe pending changes

Procedure:

1. To verify the changes, in the Database Changes tool window (`View | Tool Windows | Database Changes`), double-click the modified object. Alternatively, select the object and click the Show Diff icon (![the Show diff icon](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.vcs.diff.svg)).

2. In the [Diff Viewer](schema-comparison-and-migration.html#schema_comparison) that opens, verify your changes for the selected object.

![Diff Viewer for modified source code](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_multiple_objects_in_database_changes_diff.png)

### Step 4. Submit the changes

Submit the changes that you made in source code of database object to the database.

Procedure:

1. By default, the migration script preview for a valid script is not shown in the Object Migration dialog upon submitting. Make sure that it appears at this step. Otherwise, the valid migration script will be executed silently.

Open IDE settings by pressing `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Comma` (VSCode), `⌘ Comma` (VSCode (macOS)), navigate to `Database | Other | Refactoring`, and ensure that the Show preview of valid script when updating source text checkbox is selected.

2. To submit the changes for all the modified database objects at once, in the Database Changes tool window, select the objects and click the Submit icon (![the Submit button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.submitDB.svg)) on the toolbar.

> **Tip:**
> To submit the changes for the modified database objects one by one, select the object and click the Submit icon (![the Submit button](https://resources.jetbrains.com/help/img/idea/2026.3/database-plugin.icons.expui.submitDB.svg)) on the toolbar.

3. In the Object Migration dialog that opens, verify that the migration script is correct for all the included database objects.

GoLand can automatically generate a migration script, but you must check it before running.

4. Click OK to execute the script.

![Migration script with changes for multiple database objects](https://resources.jetbrains.com/help/img/idea/2026.3/db_tutorial_migration_script_multiple.png)

## See also

### Reference

[Database Changes tool window](database-changes-tool-window.html) [Data Sources and Drivers dialog](data-sources-and-drivers-dialog.html)

### Procedures

[Modify source code of database objects](modifying-source-code-of-database-objects.html)

### Concepts

[Introspection](glossary-database-tools-and-sql.html#introspection)

