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
On the Home page, select the workspace to which you want to add a database connection.
From the left-hand menu, select Databases to open the list of all workspace database connections.
In the Databases view, click the New connection in the upper right corner.
Notebook level
Go to Attached data icon on the left-hand sidebar.
or click theClick New connection and select New database connection.
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.
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.
In the New database connection dialog, select a database type.
In the New [database_type_name] connection dialog, fill in the following fields:
On the General tab:
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.
Select whether to use authentication.
Provide your user credentials if required by the connection type.
Specify the database if required by the connection type.
Select whether to use the IAM database authorization (where applicable).
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:
Click Refresh to get the list of the database schemas.
Select or deselect schemas for introspection.
Click the Test connection button at the bottom of the dialog.
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.
Switch to the SSH tab of the New [database_type] connection dialog.
Select the SSH checkbox.
Provide your connection details in the Host, Port, and User fields.
Use one of the two authentication types:
To use password-based authentication, fill in the Password field.
To use a key pair:
Expand the Authentication type list and select Key pair.
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.
Switch to the Advanced tab of the dialog.
Click Add key-value pair to add a parameter and its value.
Repeat the previous step for each parameter required for your connection.
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.
In the editor, open the Attached data tool.
Click Take a tour on the banner.
In the Attach a database connection popup, click Connect demo database.
In the attached data sources, click the added database to view the details and browse the schema.
If you chose not to take a tour and want to add the demo database later on, use the following credentials: