lakebase-provisioned

Provision and connect to Databricks Lakebase managed PostgreSQL instances for OLTP workloads.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/FMurray/mlfts --skill lakebase-provisioned-fmurray
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lakebase-provisioned
Source: https://github.com/FMurray/mlfts/tree/main/.agents/skills/lakebase-provisioned
Command: npx skills add https://github.com/FMurray/mlfts --skill lakebase-provisioned-fmurray

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires databricks-sdk, psycopg, sqlalchemy, and includes references (resource) components.

What problem does it solve? Setting up and maintaining connections to Databricks Lakebase Provisioned (managed PostgreSQL) involves OAuth tokens that expire hourly, DNS quirks, and unfamiliar SDK APIs, which slows down building transactional applications on Databricks. ## Core Features & Use Cases - Instance Lifecycle Management: Create, resize, start, stop, and delete Lakebase instances via the Databricks SDK, CLI, or MCP tools. - Connection Patterns: Direct psycopg3 connections for scripts, SQLAlchemy async engines with automatic OAuth token refresh for production apps, and a macOS DNS resolution workaround. - Reverse ETL: Sync Delta Lake tables into PostgreSQL with FULL or INCREMENTAL modes, scheduled via Databricks Jobs. - Use Case: You are building a Databricks App that needs persistent state. Use this Skill to provision a Lakebase instance, wire up a SQLAlchemy engine with token refresh, and register the database in Unity Catalog for governance. ## Quick Start Ask the agent to create a Lakebase Provisioned instance named my-lakebase-instance and show how to connect to it from a Python notebook.

Frequently Asked Questions about lakebase-provisioned

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to a Lakebase Provisioned instance from Python?

Use the Databricks SDK to generate an OAuth credential, then pass it as the password in a psycopg3 connection string with the instance's read_write_dns host and sslmode=require. Tokens expire after one hour, so regenerate them for long-running processes.

How do I handle Lakebase OAuth token expiration in production apps?

Run a background task that refreshes the token every 50 minutes and inject it into new connections via SQLAlchemy's do_connect event listener. This keeps a connection pool working without interruption despite the one-hour token lifetime.

What is the difference between FULL and INCREMENTAL synced tables in Lakebase?

FULL sync replaces the entire target PostgreSQL table on each run and suits small to medium source tables. INCREMENTAL sync only transfers changed rows using a tracking column, which is better for large Delta tables with reliable change timestamps.

Why does Lakebase DNS resolution fail on macOS?

Python's socket.getaddrinfo can fail on macOS with long Lakebase hostnames. Resolve the hostname with the dig command and pass the resulting IP as hostaddr to psycopg while keeping the hostname for TLS SNI.

Can I use Lakebase with Databricks Apps and LangChain agents?

Yes. Add Lakebase as an app resource with the Databricks CLI, configure it via LAKEBASE_INSTANCE_NAME and LAKEBASE_DATABASE_NAME environment variables, and declare it as an MLflow model resource. The databricks-langchain memory package supports Lakebase-backed agent state.