Datalore 2023.6 Help

Create a database connection

The article contains provides procedures explaining how to create database connections in Datalore. You have two options:

  • Workspace level: You add a database connection to a workspace. As a workspace resource, the new connection can be attached to any notebook residing in the respective notebook.

  • Notebook level: You create and attach a database connection to a notebook. This automatically adds the new connection to the resources of the respective workspace.

Use the New database connection dialog to add a database connection to a workspace or notebook.

Open the New database connection dialog

The procedure depends on whether you work on workspace or notebook level.

  • Workspace level

    1. On the Home page, select the workspace to which you want to add a database connection.

    2. From the left-hand menu, select Databases to open the list of all workspace database connections.

    3. In the Databases view, click the New connection in the upper right corner.

      Databases view

    Notebook level

    1. Go to Main menu | Tools | Attached data or click the Attached data icon on the left-hand sidebar.

    2. Click New connection and select New database connection.

      Creating connection from notebook

The New database connection dialog offers three options:

Use database-specific interface

You select a database type and manually set up the parameters required for this particular type. This procedure is described here.

Use a pre-built connection URL

Create a connection based on a pre-built connection URL. Switch to the Enter URL tab, provide the URL in the text field, and click Next. This will open the connection dialog for the respective database type with all the fields pre-filled.

Import XML

Create a connection using data provided in XML format.

  • Copy the database parameters you want to use to the clipboard.

  • Switch to the Import XML.

  • Click the Import from clipboard button. This will process the provided data and open the connection dialog for the respective database type with all the fields pre-filled.

New database connection dialog

Configure a connection using database-specific interface

This procedure describes the general workflow for all supported database types. For specific procedures, refer to the topics under this article.

  1. In the New database connection dialog, select a database type.

  2. In the New [database_type_name] connection dialog, fill in the following fields:

    • On the General tab:

      1. Select the connection type.

        • Default: to connect by specifying the Host, Port, and Database.

        • IAM cluster/region: to connect by using Database, Region, and Cluster.

        • URL only: to connect by providing the URL of a pre-built connection.

        • SID: to connect by using a unique name of an Oracle instance.

        • Service name: to connect by using an alias to an Oracle instance.

      2. Select whether to use authentication.

      3. Provide your user credentials if required by the connection type.

      4. Specify the database if required by the connection type.

      5. Select whether to use the IAM database authorization (where applicable).

      Integration with PostgreSQL, General tab
    • On the SSH tab, enable SSH and configure an SSH connection. See more details in this procedure.

    • (Optional) Configure the database introspection scope on the Schemas tab:

      1. Click Refresh to get the list of the database schemas.

      2. Select or deselect schemas for introspection.

  3. Click the Test connection button at the bottom of the dialog.

  4. Once successfully tested, click the Create connection button.

Enable SSH tunneling

Datalore can create an SSH tunnel based on the parameters you configure in the New [database_type] connection dialog.

  1. Switch to the SSH tab of the New [database_type] connection dialog.

  2. Select the SSH checkbox.

  3. Provide your connection details in the Host, Port, and User fields.

  4. Use one of the two authentication types:

    • To use password-based authentication, fill in the Password field.

    • To use a key pair:

      1. Expand the Authentication type list and select Key pair.

      2. Under Key pair, expand the list and select one of the key pairs saved in your account settings.

Manage additional parameters for your connection

Use the Advanced tab of the database connection dialog to manage additional parameters. For example, you can manage your JDBC driver custom options here.

  1. Switch to the Advanced tab of the dialog.

  2. Click Add key-value pair to add a parameter and its value.

  3. Repeat the previous step for each parameter required for your connection.

  4. Click Save and close to finish your work in the dialog or switch to another tab to continue creating the connection.

Use the demo database

If you are new to the feature, you can attach our demo database to check how databases and SQL cells work in Datalore.

  1. In the editor, open the Attached data tool.

  2. Click Take a tour on the banner.

    Database banner
  3. In the Attach a database connection popup, click Connect demo database.

    Database tour popup
  4. In the attached data sources, click the added database to view the details and browse the schema.

    Viewing the demo database schema

If you chose not to take a tour and want to add the demo database later on, use the following credentials:

driver: postgresql host: demo-database.private.datalore.io port: 5432 database: datalore user: datalore password: datalore

Last modified: 28 November 2023