Lakebase integrations
Lakebase integrations rely on PostgreSQL-compatible clients, with attribution captured via the application_name field in the connection handshake.
Supported connectors
Use one of the following connectors to connect with Lakebase:
- JDBC
- psql
- psycopg2 / psycopg3
- SQLAlchemy
Postgres JDBC driver
The PostgreSQL JDBC driver must detect that the Lakebase server supports modern startup parameters so it can send the User-Agent (Application_Name) correctly during the initial connection.
Set ASSUME_MIN_SERVER_VERSION so the driver treats the server as a newer PostgreSQL version and includes Application_Name in the startup packet. Without this setting, some clients send Application_Name later in the session, which breaks telemetry.
Setting ASSUME_MIN_SERVER_VERSION (for example, to 9.1) ensures the application name is sent upfront in the startup packet.
When using a connection string, the parameter name is typically ApplicationName (camelCase) or Application_Name, although it may vary by driver version. Verify the exact parameter name in the JDBC driver's documentation.
Partners must set it programmatically using PGProperty:
String jdbcUrl = "jdbc:postgresql://instance-<instance>.database.cloud.databricks.com:5432/<dbname>";
// Set up connection properties
Properties props = new Properties();
PGProperty.USER.set(props, "<email>");
PGProperty.PASSWORD.set(props, "<OAuth token>");
PGProperty.APPLICATION_NAME.set(props, "<isv-name_product-name>/<product-version>");
PGProperty.ASSUME_MIN_SERVER_VERSION.set(props, "9.1");
PGProperty.SSL.set(props, "require");
Connection conn = DriverManager.getConnection(jdbcUrl, props);
Other integrations
For psql, psycopg, and SQLAlchemy, the application_name parameter (all lowercase) is set at connection time and remains in effect for the entire session.
Set the application name using the format:
<isv-name_product-name>/<product-version>
psql client
psql "host=instance-*** user=*** dbname=*** port=5432 sslmode=require application_name=<isv-name_product-name>/<product-version>"
psycopg2/3 (Python)
conn = psycopg2.connect(
host="instance-***",
port=5432,
dbname="dbname",
user="user",
password="<OAuth token>",
application_name="<isv-name_product-name>/<product-version>"
)
SQLAlchemy (Python)
from sqlalchemy import create_engine
engine = create_engine(
"postgresql+psycopg2://user:<OAuth token>@host:5432/dbname"
"?application_name=<isv-name_product-name>/<product-version>"
)
Validating your implementation
To confirm that the integration is passing the application_name correctly, run the following query in the Databricks Query Editor connected to Lakebase while the partner product has active connections:
SELECT pid,
usename,
client_addr,
application_name,
state,
query
FROM pg_stat_activity
ORDER BY application_name;
This query displays all active connections and their associated application_name values.
If the partner application closes connections quickly (e.g., millisecond queries or no persistent pool), the connection may not appear in pg_stat_activity. In such cases, run a long-running query from the product to keep the session active long enough for validation:
SELECT COUNT(*)
FROM generate_series(1,100000) a
CROSS JOIN generate_series(1,100000) b;
What's next
- Learn about Lakebase integration patterns: See OLTP (Lakebase) for authentication and operational guidance.
- Review all integration types: See the complete list of supported integrations.
- Review User-Agent format: Understand the required format and guidelines.