databricks/databricks-agent-skills/databricks-lakebase
Claude Code and agent skill by databricks/databricks-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Databricks Lakebase Postgres: projects, scaling, connectivity, Lakebase synced tables, and Data API. Use when asked about Lakebase databases, OLTP storage, or connecting apps to Postgres on Databricks.
Install
npx vskill@latest install databricks/databricks-agent-skills/databricks-lakebaseSKILL.md
Lakebase Postgres Autoscaling
FIRST: Use the parent databricks-core skill for CLI basics, authentication, and profile selection.
Lakebase is Databricks' serverless Postgres-compatible database, available on AWS and Azure (GA) and on GCP (Beta). It provides fully managed OLTP storage with autoscaling, branching, and scale-to-zero.
Regions: Lakebase runs only in the commercial regions listed in Region availability (check the page for the user's cloud). It isn't available on AWS GovCloud, and the Azure list has no Azure Government or Azure China regions. If the workspace is in one of these clouds or an unlisted region, tell the user that Lakebase isn't available there. Don't try to create a project.
Provisioned Lakebase no longer exists. Never create it. The old Provisioned tier (static, non-scalable Postgres;databricks databaseCLI /w.databaseSDK) is being migrated to Autoscaling over summer 2026, with no customer action required. Lakebase today is Autoscaling-only (databricks postgres/w.postgres). Do not attempt to create Provisioned instances; if a user asks for one, tell them Provisioned instances don't exist anymore and point them to Autoscaling. Treat the legacydatabaseresource key in app configs as retired, and migrate to thepostgresresource key. For the legacy DABsynced_database_tablesresource, use thepostgres_synced_tablesbundle resource or thedatabricks postgres create-synced-tableCLI flow instead (see the Common Issues row andreferences/synced-tables.md).
For context when reading older configs or docs, here is how the retired Provisioned tier maps to Autoscaling:
| Aspect | Provisioned (retired) | Autoscaling (current) | |
|---|---|---|---|
| CLI group | databricks database | databricks postgres | |
| Top-level resource | Instance | Project | |
| Capacity | CU_1–CU_8 (16 GB/CU) | 0.5–112 CU (2 GB/CU) | |
| Branching | Not supported | Full support | |
| Scale-to-zero | Not supported | Configurable | |
| HA | Readable secondaries | 1–3 secondaries + read replicas | |
| Data API | Not available | PostgREST HTTP API | |
| Cloud | AWS only | AWS and Azure (GA), GCP (Beta) |
Compliance: Supports HIPAA, C5, TISAX, or None. Before any PHI goes into Lakebase, apply the HIPAA gate below.
HIPAA Gate (PHI)
HIPAA coverage comes from the workspace: the compliance security profile with the HIPAA standard, plus a Business Associate Agreement. Confirm both with the user before PHI goes in. Then:
- Preview features: do not use a Preview or Beta feature (for example, Lakehouse Sync) for PHI unless it is listed for your region in Regional support for features. Check the list each time.
- Existing projects: a project that was running when HIPAA was turned on has no HIPAA audit logging until its compute restarts. Databricks does not restart it for you. Restart each compute.
- No PHI in metadata: never put PHI in database, schema, table, column, or role names, in tags, or in other customer-defined fields. These appear in audit logs and system metadata, and Databricks cannot remove them later.
- No PHI in SQL text: pass PHI values as query parameters, never as literals. Audit logs record statement text.
- No PHI in logs or tickets: keep PHI out of app logs, error messages, screenshots, diagnostic output, and support requests.
- Least privilege: grant each role only the schemas, tables, and operations it needs.
Sources: HIPAA compliance for Lakebase, Enable HIPAA compliance.
Row-Level Security and Data API: Must-Follow Rules
Apply these whenever a design has per-user rows, RLS, or the Data API. Details and tests are in connectivity.md.
- Many end users: a branch holds at most 500 Postgres roles. Never create one role per app user. The app connects as its service principal over a pool and sets the user per transaction:
SELECT set_config('app.user', $1, true). - RLS on a setting: wrap it in
NULLIF:USING (owner_email = (SELECT NULLIF(current_setting('app.user', true), ''))). On a reused pooled connection, an unset value reads'', not NULL. Also runALTER TABLE ... FORCE ROW LEVEL SECURITY, because the table owner bypasses RLS otherwise. - Testing RLS: never test as the project owner or
databricks_superuser, and never grantdatabricks_superuserto a teammate for local work. Both bypass RLS. Use a role with onlyUSAGEon the app's schema and the table privileges it needs. - Views over RLS tables: create them
WITH (security_invoker = true), and grant the callerSELECTon the base table too. A default view checks RLS as its owner, so every caller sees all rows. - Data API before production: the defaults are open. Empty CORS origins means all origins, and empty maximum rows means no limit. Set the exact app origins and a row limit, and expose only the schema built for the API, not
public.
Capabilities
- Project lifecycle -- create, update, delete Lakebase Postgres Autoscaling projects
- Branching -- copy-on-write branches with TTL, point-in-time recovery, and reset
- Compute scaling -- autoscale 0.5--64 CU, fixed up to 112 CU, scale-to-zero
- High availability -- 1 primary + 1--3 secondaries, automatic failover
- PostgreSQL connectivity -- OAuth token refresh, connection pooling, SSL
- Data API -- PostgREST-compatible HTTP CRUD (Autoscaling only)
- Lakebase synced tables -- sync Unity Catalog Delta tables into Postgres (previously known as Reverse ETL)
- Databricks App integration -- scaffold apps with Lakebase feature, deploy-first workflow
- Cloud support -- AWS and Azure (GA), GCP (Beta)
Reference docs:
- computes-and-scaling.md — Sizing, endpoint management, scale-to-zero, HA
- connectivity.md — Connection patterns, token refresh, Data API
- synced-tables.md — Lakebase synced tables, data type mapping, capacity planning
- lakehouse-sync.md — CDC from Lakebase Postgres to Unity Catalog Delta tables (programmable via
databricks postgres *-cdf-config/w.postgres.*_cdf_config, Beta) - pgvector.md — Vector similarity search with pgvector extension
- off-platform.md — Off-platform Lakebase (NOT Databricks Apps): external Node.js apps connecting via
@databricks/lakebase, env management, token refresh, Drizzle ORM
Resource Hierarchy
- Project: Top-level container. Creating one auto-provisions a
productionbranch and aprimaryread-write endpoint. - Branch: Isolated database environment sharing storage with parent (copy-on-write). States:
READY,ARCHIVED. - Endpoint (called Compute in UI): Compute resource powering a branch. Types:
ENDPOINT_TYPE_READ_WRITE,ENDPOINT_TYPE_READ_ONLY. - Database: Standard Postgres database within a branch. Default:
databricks_postgres. - Role: Postgres role within a branch.
Resource Name Formats
| Resource | Format | |
|---|---|---|
| Project | projects/{project_id} | |
| Branch | projects/{project_id}/branches/{branch_id} | |
| Endpoint | projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id} | |
| Database | projects/{project_id}/branches/{branch_id}/databases/{database_id} |
All IDs: 1-63 characters, start with lowercase letter, lowercase letters/numbers/hyphens only (RFC 1123).
CLI Discovery -- ALWAYS Do This First
Note: "Lakebase" is the product name; the CLI command group ispostgres. All commands usedatabricks postgres ....
Do NOT guess command syntax. Discover available commands dynamically:
Create a Project
First decide: reuse or create. When building or attaching to an app, ask the user whether to reuse an existing project/branch/database — list them withdatabricks postgres list-projects(thenlist-branches/list-databases), let the user pick, and confirm which schema the app will own — or create a new project. Only skip listing and create directly when the user explicitly asked for a brand-new project.
Auto-creates: production branch + primary read-write endpoint with scale-to-zero on (24 h timeout). The documented default size is 8–16 CU (autoscaling), but a project created with the CLI can get a 1 CU min/max endpoint instead. Check the size with get-endpoint and resize with update-endpoint if the workload needs more. Long-running operation; CLI waits by default. Use --no-wait to return immediately.
After creation, verify:
Extract connection values from JSON output:
| Value | JSON path | Used for | |
|---|---|---|---|
| Endpoint host | status.hosts.host | PGHOST, lakebase.postgres.host | |
| Endpoint resource path | name | LAKEBASE_ENDPOINT, lakebase.postgres.endpointPath | |
| Database resource path | name | lakebase.postgres.database | |
| PostgreSQL database name | status.postgres_database | PGDATABASE, lakebase.postgres.databaseName |
Updating a Project
Deleting a Project
WARNING: Permanent -- deletes all branches, computes, databases, roles, and data. Do not delete without explicit user permission.
Autoscaling
Endpoints use compute units (CU) (~2 GB RAM per CU). Range: 0.5--64 CU (autoscaling or fixed), 65--112 CU (fixed only). Scale-to-zero enabled by default on every branch, including production (24 h timeout; computes ≤ 32 CU only).
See computes-and-scaling.md for sizing tables, endpoint CRUD, and configuration details.
Branches
Branches are copy-on-write snapshots. Use for testing schema migrations, trying queries, or previewing data changes without affecting production.
Branches require an expiration policy: "no_expiry": true for permanent, or "ttl": "<seconds>s" (max 30 days).
Limits: 500 branches per project. Per-branch storage quota is adjustable on request (contact Databricks Support). 500 Postgres roles per branch. 1,000 projects per workspace. For apps with many end users, do not create one role per user; see "Many Users: Roles and RLS at Scale" in connectivity.md.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/databricks-lakebase/SKILL.md
Popularity
- Repository stars
- 47
- Repository forks
- 11
- 7-day trend score
- 19
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Mar 2026, 8 months ago.
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/databricks/databricks-agent-skills/databricks-lakebase)