thomazrossito/data-agents/databricks-lakebase-provisioned
Claude Code and agent skill by thomazrossito/data-agents
- community
Checking that the SKILL.md file is still in the repository.
Patterns and best practices for Lakebase Provisioned (Databricks managed PostgreSQL) for OLTP workloads. Use when creating Lakebase instances, connecting applications or Databricks Apps to PostgreSQL, implementing reverse ETL via synced tables, storing agent or chat memory, or configuring OAuth authentication for Lakebase.
Install
npx vskill@latest install thomazrossito/data-agents/databricks-lakebase-provisionedSKILL.md
The same SKILL.md was published earlier as thomazrossito/data-agents/databricks-lakebase-provisioned.
Lakebase Provisioned
Patterns and best practices for using Lakebase Provisioned (Databricks managed PostgreSQL) for OLTP workloads.
When to Use
Use this skill when:
- Building applications that need a PostgreSQL database for transactional workloads
- Adding persistent state to Databricks Apps
- Implementing reverse ETL from Delta Lake to an operational database
- Storing chat/agent memory for LangChain applications
Overview
Lakebase Provisioned is Databricks' managed PostgreSQL database service for OLTP (Online Transaction Processing) workloads. It provides a fully managed PostgreSQL-compatible database that integrates with Unity Catalog and supports OAuth token-based authentication.
| Feature | Description | |
|---|---|---|
| Managed PostgreSQL | Fully managed instances with automatic provisioning | |
| OAuth Authentication | Token-based auth via Databricks SDK (1-hour expiry) | |
| Unity Catalog | Register databases for governance | |
| Reverse ETL | Sync data from Delta tables to PostgreSQL | |
| Apps Integration | First-class support in Databricks Apps |
Available Regions (AWS): us-east-1, us-east-2, us-west-2, eu-central-1, eu-west-1, ap-south-1, ap-southeast-1, ap-southeast-2
Quick Start
Create and connect to a Lakebase Provisioned instance:
Common Patterns
Generate OAuth Token
Connect from Notebook
SQLAlchemy with Token Refresh (Production)
For long-running applications, tokens must be refreshed (expire after 1 hour):
Databricks Apps Integration
For Databricks Apps, use environment variables for configuration:
Add Lakebase as an app resource via CLI:
Register with Unity Catalog
MLflow Model Resources
Declare Lakebase as a model resource for automatic credential provisioning:
MCP Tools
The following MCP tools are available for managing Lakebase infrastructure. Use type="provisioned" for Lakebase Provisioned.
manage_lakebase_database - Database Management
| Action | Description | Required Params | |
|---|---|---|---|
create_or_update | Create or update a database | name | |
get | Get database details | name | |
list | List all databases | (none, optional type filter) | |
delete | Delete database and resources | name |
Example usage:
manage_lakebase_sync - Reverse ETL
| Action | Description | Required Params | |
|---|---|---|---|
create_or_update | Set up reverse ETL from Delta to Lakebase | instance_name, source_table_name, target_table_name | |
delete | Remove synced table (and optionally catalog) | table_name |
Example usage:
generate_lakebase_credential - OAuth Tokens
Generate OAuth token (~1hr) for PostgreSQL connections. Use as password with sslmode=require.
Reference Files
- connection-patterns.md - Detailed connection patterns for different use cases
- reverse-etl.md - Syncing data from Delta Lake to Lakebase
CLI Quick Reference
Common Issues
| Issue | Solution | |
|---|---|---|
| Token expired during long query | Implement token refresh loop (see SQLAlchemy with Token Refresh section); tokens expire after 1 hour | |
| DNS resolution fails on macOS | Use dig command to resolve hostname, pass hostaddr to psycopg | |
| Connection refused | Ensure instance is not stopped; check instance.state | |
| Permission denied | User must be granted access to the Lakebase instance | |
| SSL required error | Always use sslmode=require in connection string |
SDK Version Requirements
- Databricks SDK for Python: >= 0.61.0 (0.81.0+ recommended for full API support)
- psycopg: 3.x (supports
hostaddrparameter for DNS workaround) - SQLAlchemy: 2.x with
postgresql+psycopgdriver
Notes
- Capacity values use compute unit sizing:
CU_1,CU_2,CU_4,CU_8. - Lakebase Autoscaling is a newer offering with automatic scaling but limited regional availability. This skill focuses on Lakebase Provisioned which is more widely available.
- For memory/state in LangChain agents, use
databricks-langchain[memory]which includes Lakebase support. - Tokens are short-lived (1 hour) - production apps MUST implement token refresh.
Related Skills
- [databricks-app-apx](../databricks-app-apx/SKILL.md) - full-stack apps that can use Lakebase for persistence
- [databricks-app-python](../databricks-app-python/SKILL.md) - Python apps with Lakebase backend
- [databricks-python-sdk](../databricks-python-sdk/SKILL.md) - SDK used for instance management and token generation
- [databricks-bundles](../databricks-bundles/SKILL.md) - deploying apps with Lakebase resources
- [databricks-jobs](../databricks-jobs/SKILL.md) - scheduling reverse ETL sync jobs
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/databricks/databricks-lakebase-provisioned/SKILL.md
Popularity
- Repository stars
- 30
- Repository forks
- 20
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thomazrossito/data-agents/databricks-lakebase-provisioned)