Skip to main content

Connect with DBeaver

Beta

Lakebase Postgres (Autoscaling Beta) is the next version of Lakebase, available for evaluation only. For production workloads, use Lakebase Public Preview. See choosing between versions to understand which version is right for you.

DBeaver is a versatile universal database management tool that supports a wide range of databases, including PostgreSQL. It provides a rich set of features for database administration, query development, and data visualization.

Prerequisites

  • DBeaver Community or Enterprise edition installed on your system
  • A Lakebase database project with a Postgres role configured
note

We recommend using native Postgres password authentication when connecting with DBeaver. Native Postgres passwords don't expire hourly like OAuth tokens, making them better suited for applications that cannot refresh credentials frequently. See Authentication overview for details about authentication methods.

Install DBeaver

If you don't have DBeaver installed, download and install it from the DBeaver website.

Understanding the connection string

Lakebase provides a connection string that contains all the information needed to connect. Here's how to parse it:

postgresql://role_name:password@ep-abc-123.databricks.com/databricks_postgres?sslmode=require
^ ^ ^ ^
user -| | |- hostname |- database
|
|- password
note

DBeaver and other Java-based tools work best when you provide connection details in separate fields rather than as a connection string.

For more details about connection strings, see Understanding connection strings.

Connect to your database

  1. Get connection details from Lakebase:

    • Navigate to the Lakebase App and select your database project
    • Click Connect to open the database connection modal
    • Select the branch, compute, and database you want to connect to
    • Select a Postgres role from the dropdown (we recommend using a native Postgres role with password authentication)
    • Note the connection details
  2. Create a new database connection in DBeaver:

    • Open DBeaver
    • Click the New Database Connection button (plug icon) or select Database > New Database Connection from the menu
    • In the Connect to Database wizard, select PostgreSQL from the list of database types
    • Click Next
  3. Enter connection details:

    • Host: Enter your compute endpoint hostname (e.g., ep-abc-123.databricks.com)
    • Port: 5432
    • Database: Enter your database name (e.g., databricks_postgres)
    • Username: Enter your Postgres role name (e.g., role_name)
    • Password: Enter your Postgres role password
    • Show all databases: Enable this option to see all databases in your project
  4. Configure SSL:

    • Click Edit Driver Settings
    • Under the Driver Properties tab, find sslmode and set it to require
    • Click OK to return to the connection dialog
  5. Test and save the connection:

    • Click Test Connection to verify the connection details
    • If successful, click Finish to save the connection

Your Lakebase database connection will now appear in the left sidebar under Database Navigator.

Using DBeaver

Once connected, you can:

Run SQL queries

  • Right-click your database connection in the left sidebar
  • Select SQL Editor > New SQL Script
  • Enter your SQL queries in the editor
  • Click the Execute button (play icon) to run them
  • View results in the results pane below the editor

Manage tables

  • Expand your database connection in the left sidebar
  • Navigate to Databases > [your database] > Schemas > public > Tables
  • Right-click Tables to create a new table
  • Right-click an existing table to view, edit, or manage it

Import and export data

To import data:

  • Right-click a table and select Import Data
  • Choose the source file format (e.g., CSV, JSON)
  • Follow the prompts to map columns and import

To export data:

  • Right-click a table and select Export Data
  • Choose the export format (e.g., CSV, JSON)
  • Follow the prompts to save the file

Visual query builder

DBeaver includes a visual query builder that lets you construct queries graphically by selecting tables, columns, and conditions.

Troubleshooting

Connection string not accepted

DBeaver and other Java-based tools that use the pgJDBC driver may not support including role name and password in a database connection string. If you encounter issues with connection strings, use the separate connection detail fields as described in this guide instead.

Connection security

Lakebase requires that all connections use SSL/TLS encryption. Ensure sslmode is set to require in the driver properties.

For more information about connection strings and authentication options, see Connect to your database project.