SAP HANA Database Explorer for Visual Studio Code
This extension provides functionality for accessing SAP HANA databases, browsing the database catalog, and executing SQL from a SQL console. Since this extension does not offer the full feature scope of the SAP HANA Database Explorer in the Cloud, links for opening the SAP HANA Database Explorer are provided where appropriate to easily access additional features.
To use this extension you need a licensed version or a trial version of SAP HANA Cloud. An SAP HANA Cloud license also allows a user to access the SAP HANA Database Explorer to connect to the SAP HANA Cloud instance.
The Cloud Foundry CLI is required for accessing the list of databases from SAP HANA Database Explorer on the SAP Business Technology Platform (BTP).
To simplify the connection to Cloud Foundry it is recommended to install the Cloud Foundry Tools extension. If the extension is installed, the login to Cloud Foundry will be triggered automatically. If the extension is not installed, please make sure you are logged in to Cloud Foundry via the Cloud Foundry CLI.
If you want to manage database connection credentials in the SAP HANA User Store you have to download and install an SAP HANA client package that contains the SAP HANA User Store executable (hdbuserstore).
There are several ways to configure which SAP HANA Database Explorer SAP BTP URL will be opened:
If you do not need to access the database connections from SAP HANA Database Explorer on SAP BTP, you can disable it in the "SAP HANA Database Explorer" extension settings.
You can configure the maximum number of result rows returned by the SQL console as well as the maximum number of kilobytes fetched for large objects (LOBs) in the "SAP HANA Database Explorer" extension settings.
The SAP HANA Database Explorer extension offers the following types of connection:
The list of database connections can be filtered by name via a database filter that can be set via the "filter" icon in the database list title bar or the "Select Database" command in the Command Palette.
Local connections can be added to a Visual Studio Code installation by specifying the connection data (host, port, user name, password) as well as connection options. Local connections use the SAP HANA database client to directly connect to the database. Local connections can be added in the following variants:
SAP HANA User Store Connections
SAP HANA User Store connections are intended for connecting to an SAP HANA Cloud or SAP HANA instance whose database connection credentials are stored in the SAP HANA User Store. The database connection Wizard allows you to select an SAP HANA User Store key and displays the information retrieved from the SAP HANA User Store. Options such as encryption or advanced settings can be specified for each connection.
To add a new database connection to Visual Studio Code which uses credentials stored in the SAP HANA User Store, perform the following steps:
SAP HANA Database Explorer Connections
The SAP HANA Database Explorer extension can access the connections maintained in the SAP HANA Database Explorer on SAP BTP. This enables the reuse of connection data already entered in the Cloud; it is not necessary to enter the data again in the Visual Studio Code extension.
To access the SAP HANA Database Explorer on SAP BTP, an authentication token is required. This extension uses the Cloud Foundry OAuth token from the current machine. For this reason, a prerequisite for using SAP HANA Database Explorer connections is that the Cloud Foundry CLI must already be installed and you must be logged in to the SAP BTP region where the SAP HANA Database Explorer connections are maintained. If the Cloud Foundry CLI is not installed or the OAuth token is missing or invalid, the SAP HANA Database Connections will not be available.
The catalog browser shows database objects for a particular database connection. To see the database objects, expand the "Catalog" folder of a database connection and select a database object type ("Tables", "Views", etc.) After selecting the database object type the catalog browser will load the list of object of that type that are accessible to the current user.
By default the list of database objects is filtered by the current connection's default schema. To see objects from other schemas the schema filter can be adjusted via the "filter" icon in the catalog browser title bar or the "Apply filter" command in the Command Palette.
The list of database objects can be filtered by object via the standard Visual Studio Code document tree filtering functionality or via a database-level filter that can be set via the "filter" icon in the catalog browser title bar.
For more information about the catalog browser please refer to the SAP HANA Cloud, SAP HANA Database Developer Guide.
Database Object Operations
A context menu provides access to operations on individual database objects (not all operations may be available for all objects).
The dependency viewer can visualize database object dependencies across the entire object hierarchy. It can be started either on a database connection in the database connection list or a database object in the catalog browser.
If the dependency viewer is started on a database connection the canvas will be blank initially. You can select an object to visualize by choosing an object in the "Select Object" menu at the top of the canvas.
If the dependency viewer is started on an object in the catalog browser, the canvas will directly visualize the selected object's dependencies.
When Visual Studio Code is closed with an open SAP HANA SQL Console tab that contains unsaved changes, and the
The SAP HANA client used by default for local database connections is platform-dependent. On platforms not supported by the SAP HANA client an alternative HANA client is used. However, this client does not support SAP HANA User Store connections which is why SAP HANA User Store connections are not available on these platforms.
If you would like to report an issue or suggest an improvement, please open a support ticket via the SAP Support Portal.
The tool collects non-personally identifiable information about your usage of the tool to improve its services. If you do not want the tool to collect any usage data, you can set the Enable Sap Web Analytics option in User Preferences to "false". Go to File > Preferences (macOS: Code > Preferences) > Settings > Extensions > SAP HANA Database Explorer, and deselect the Enable Sap Web Analytics checkbox.
This extension is provided under the terms of the SAP Developer License Agreement.