# Database Server

## Overview

There will be one Database Server node in the [Solution Explorer](https://docs.servoy.com/reference/servoy-developer/solution-explorer/..#overview) for each connection that you have configured. Expanding this node will show a list of all [tables](https://docs.servoy.com/reference/servoy-developer/solution-explorer/resources/database-servers/tables#tables) (they are also displayed in the [contextual list](https://docs.servoy.com/reference/servoy-developer/solution-explorer-contextual-list#overview)), [procedures](https://docs.servoy.com/reference/servoy-developer/solution-explorer/resources/database-servers/database-server/procedures) and [views](https://docs.servoy.com/reference/servoy-developer/solution-explorer/resources/database-servers/database-server/views).

## Commands Summary

The following commands are available for any Database Server nodes. They can be accessed by right-clicking the context menu:

| Command                                                                           | Summary                                                                                                                                                                                                                                                                                                                              |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [Open Server](#open-server)                                                       | Opens the DB Server connection in the [Database Connection Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor).                                                                                                                                                             |
| [Create Table](#create-table)                                                     | Creates a new table in the target database and opens the [Table Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/table-editor)                                                                                                                                                                              |
| [Duplicate Server](#duplicate-server)                                             | Creates a new DB Server connection with identical connection [properties](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor) and opens it in the [Database Connection Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor) |
| [Enable/Disable Server](#enable-disable-server)                                   | Toggles the [enabled](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor) property of DB Server                                                                                                                                                                                     |
| [Synchronize with DB Server Information](#synchronize-with-db-server-information) | Opens the [Database Synchronization Wizard](https://docs.servoy.com/reference/servoy-developer/object-editors/database-synchronization-wizard)                                                                                                                                                                                       |
| [Update Metadata](#update-metadata)                                               | Opens the [Metadata Synchronization Wizard](https://docs.servoy.com/reference/servoy-developer/object-editors/metadata-synchronization-wizard)                                                                                                                                                                                       |
| [Reload Tables/Structure from DB](#reload-tables-structure-from-db)               | Reloads the schema from the database                                                                                                                                                                                                                                                                                                 |
| [Load Relations](#load-relations)                                                 | Can create relations based on database tables FOREIGN KEY constraints.                                                                                                                                                                                                                                                               |
| [Flag Tenant Columns](#flag-tenant-columns)                                       | Specifies the column name which can be used as a tenant filter for all tables                                                                                                                                                                                                                                                        |
| [Suggest Foreign Types](#suggest-foreign-types)                                   | Sets foreign types to columns                                                                                                                                                                                                                                                                                                        |
| [Delete Database Connection](#delete-database-connection)                         | Deletes this DB Server connection                                                                                                                                                                                                                                                                                                    |

## Commands Details

The details for each command available on this item via right-click context menu:

### Open Server

Opens the DB Server connection in the [Database Connection Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor).

### Create Table

Creates a new table in the target database and opens the [Table Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/table-editor).

### Duplicate Server

Creates a new DB Server connection with identical connection [properties](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor) and opens it in the [Database Connection Editor](https://docs.servoy.com/reference/servoy-developer/object-editors/database-server-connection-editor)

### Enable/Disable Server

Toggles the enabled property of DB Server.

### Synchronize with DB Server Information

Use this command to synchronize between the database schema and the [Database Information (.dbi) files](https://docs.servoy.com/reference/servoy-developer/project-file-structure/workspace-folder/resources-directory/database-information-.dbi-files) in your project. This command will open the [database synchronization wizard](https://docs.servoy.com/reference/servoy-developer/object-editors/database-synchronization-wizard), where you can resolve differences between the schema and your .dbi files.

### Update Metadata

Opens a wizard to synchronize the metadata tables content (which have special structure and are marked as such from table editor) and metadata tables workspace content.

### Reload Tables/Structure from DB

Reloads tables from database. Should be used when tables are modified outside Servoy, in order to refresh them.

### Load Relations

Opens a wizard for creating relations based on foreign key constraints from the database. Useful when having an existing database, in order to quickly create some relations.

### Flag Tenant Columns

Sets a column name to be used as tenant column for all tables in selected database.

### Suggest Foreign Types

Opens a wizard which can set Foreign Type on columns based on suggestion.

### Delete Database Connection

Deletes the database connection (not the database itself). The database connection is stored under servoy.properties file
