Skip to main content

Getting Started

LakeBase is Onehouse's PostgreSQL-compatible managed lakehouse engine. The SDK provides a psycopg2-backed client that handles the browser-based and federated authentication flows LakeBase clusters require, on top of standard username/password auth.

Installation

pip install onehouse-python-sdk[lakebase]

Requires Python 3.9+.

Quickstart

from onehouse_python_sdk import LakebaseClient

# Username / password
with LakebaseClient().connect(
host="<cluster-host>",
port=5432,
dbname="mydb",
user="admin",
password="secret",
) as client:
rows = client.fetchall("SELECT * FROM mytable WHERE id = %s", (42,))

The client is a context manager — it closes the underlying connection on exit.

Next steps

  • Authentication — supported auth flows (username/password, OIDC, Azure AD, SAML, …)
  • Client APISqlClient interface reference
  • Notes — credential caching and callback port configuration