Configures Atlas schema management for Databricks Lakebase: token auth, endpoint host, Postgres roles, managed objects (__db_system, grant functions, triggers), and exclusion patterns. Use with atlas and atlas-postgres skills.
Ships in Atlas. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
What is specific to Databricks Lakebase when Atlas manages the schema. Lakebase is managed PostgreSQL,
and Atlas connects to it with the postgres driver: the atlas-postgres skill covers the schema work
(URL scope, the dev database, roles and grants, objects, lint, and tests), and the atlas skill covers
the workflows. This skill covers connecting to Lakebase and the objects Lakebase manages. Guide:
https://atlasgo.io/guides/postgres/databricks-lakebase.
The atlas and atlas-postgres skills, installed next to this one. Read ../atlas-postgres/SKILL.md
and ../atlas/SKILL.md before you start, and follow them for everything this skill does not cover:
this skill only adds what differs on Lakebase. If one is missing, download
https://atlasgo.io/skills//SKILL.md to ../<skill>/SKILL.md, and each reference file listed in
its Files section to ../<skill>/references/<name>.
Check the login first with atlas whoami. If it shows no login, ask the user to run atlas login:
the databricks_lakebase_token data source needs it. A user without an account can start a free
trial with atlas login. An Atlas release older than the data source fails every env in the file
with missing data source handler for "databricks_lakebase_token": run atlas version, and install
the latest release.
Connect with a token from the data source. endpoint is the endpoint path, and the URL user is the
Postgres role of the identity the token is issued to: the email of a Databricks user, or the
application ID of a service principal. urluserinfo sets both and escapes the @:
locals {
host = "ep-example.database.us-west-2.cloud.databricks.com"
user = "[email protected]"
}
data "databricks_lakebase_token" "db" {
endpoint = "projects/my-app/branches/production/endpoints/primary"
}
env "lakebase" {
url = urluserinfo(
"postgres://${local.host}:5432/databricks_postgres?sslmode=require&search_path=public",
local.user,
data.databricks_lakebase_token.db,
)
dev = "docker://postgres/17/dev?search_path=public"
// Functions that Lakebase manages in "public" (Rule 5).
exclude = [
"grant_usage_on_new_schema[type=function]",
"grant_all_on_new_sequences[type=function]",
"grant_select_on_new_objects[type=function]",
]
schema {
src = "file://schema.sql"
}
}
The host is the endpoint's host, never the -pooler host, which fails with
OAuth authentication is not supported with pooled connections. This prints each endpoint path
on a branch, followed by its host:
databricks postgres list-endpoints projects/<project>/branches/<branch> -o json \
| jq -r '.[] | "\(.name) \(.status.hosts.host)"'
databricks_postgres is the database Lakebase creates on every branch.
A token expires one hour after it is issued. Atlas generates a new one each time it loads
atlas.hcl, so each command starts with a valid token.
The data source finds Databricks credentials with unified authentication; the URL user only names the Postgres role:
databricks auth login --host <workspace-url> --profile lakebase, then
profile = "lakebase" in the data source, or DATABRICKS_CONFIG_PROFILE=lakebase. That profile
gets its token from the Databricks CLI, so databricks must be on the PATH wherever Atlas runs.DATABRICKS_HOST, DATABRICKS_CLIENT_ID, and
DATABRICKS_CLIENT_SECRET (from the CI secret store). It needs an OAuth secret, the
workspace-access entitlement, and an OAuth role on the branch; the URL user is its application
ID. Give the secret only to the jobs that apply migrations, from a scope that only the default
branch can read, such as a protected environment, and grant the role only the privileges those
migrations need.getenv("LAKEBASE_USER") and
getenv("LAKEBASE_PASSWORD") to urluserinfo. Prefer tokens where the identity can use them.The dev database runs the project's Postgres version, which this prints:
databricks postgres get-project projects/<project> -o json | jq .status.pg_version. Use
docker://postgres/<version>/dev, with the target's scope (atlas-postgres, Rule 2).
Every Lakebase database has a __db_system schema, three functions in public
(grant_usage_on_new_schema, grant_all_on_new_sequences, grant_select_on_new_objects), and three
event triggers that call them (on_create_schema, on_create_sequence, on_create_table_or_view).
The env excludes them, or Atlas plans to drop them:
At schema scope (search_path=public), exclude the functions by exact name, as in Rule 2.
Without it, schema apply plans to drop them and fails with 2BP01. Never use a grant_*
pattern: it also hides the user's own functions from every plan, without a warning.
At database scope (several schemas, no search_path in either URL), qualify the functions with
public., and exclude __db_system and the event triggers by name. Without the event triggers,
planning fails with function public.grant_usage_on_new_schema() does not exist (42883):
exclude = [
"__db_system",
"on_create_schema",
"on_create_sequence",
"on_create_table_or_view",
"public.grant_usage_on_new_schema[type=function]",
"public.grant_all_on_new_sequences[type=function]",
"public.grant_select_on_new_objects[type=function]",
]
The functions of the databricks_auth extension belong to the extension and need no exclude.
The versioned workflow runs only the migration files, so migrate apply does not need the exclude.
Keep it in the env anyway: drift checks read it, and report the objects Lakebase manages as drift
without it. A drift.exclude list in check "migrate_apply", and migration.exclude or
--exclude for migrate drift, replace exclude instead of adding to it: repeat the Rule 5
patterns there. At database scope, the first migrate apply on a new database fails with
connected database is not clean: found schema "__db_system": run that first apply with
--allow-dirty (https://atlasgo.io/versioned/apply#allow-dirty).
The role that runs the migrations owns the objects they create, and only the owner or a member of its role can alter them. Keep deploying as the same role, or grant that role to the identity that replaces it.
Schema changes, lint, and tests follow atlas-postgres and atlas: validate the schema, test the
change with atlas schema test and atlas migrate test, and lint it before reporting it done.
| Question | Answer |
|---|---|
missing data source handler for "databricks_lakebase_token" | The installed Atlas predates the data source: install the latest release (Rule 1) |
default auth: cannot configure default credentials | No Databricks credentials: databricks auth login with profile, or the service principal variables (Rule 3) |
default auth: databricks CLI not found | The profile gets its token from the Databricks CLI: install it where Atlas runs (Rule 3) |
Endpoint name expects 'projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}' format | endpoint must be the full endpoint path (Rule 2) |
OAuth authentication is not supported with pooled connections | Use the endpoint host, not the -pooler host (Rule 2) |
This API is disabled for users without the workspace-access entitlement | Turn on Workspace access for the service principal (Rule 3) |
| A valid token fails to log in | The URL user must be the Postgres role of the identity the token is issued to (Rule 2) |
cannot drop function grant_... because other objects depend on it (2BP01) | Exclude the three functions by exact name (Rule 5) |
create event trigger "on_create_schema": pq: function public.grant_usage_on_new_schema() does not exist (42883) | At database scope, also exclude the event triggers and __db_system (Rule 5) |
connected database is not clean: found schema "__db_system" | The first migrate apply on a new database at database scope: run it once with --allow-dirty (Rule 6). An existing database takes baseline instead (https://atlasgo.io/versioned/apply#existing-databases) |
Drift reports the grant_* functions, the on_create_* event triggers, or __db_system | Keep the Rule 5 excludes in the env the drift check reads, and repeat them in its drift.exclude or migration.exclude list if it sets one: those replace exclude (Rule 6) |
must be owner of table ... | Another role created the table: deploy as that role, or grant it to this one (Rule 7) |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
14 skills in this plugin
/atlasDatabase schema management, migrations, data scripts, and Atlas Cloud operations with the Atlas CLI. Use when: generating or applying migrations, diffing, linting, validating, or testing schemas, working with atlas.hcl, schema.hcl, or ORM schemas (GORM, Drizzle, SQLAlchemy, Django, Ent, Sequelize, TypeORM, Prisma), running data backfills, purges, or reports with atlas script, or answering questions about Atlas Cloud: which databases are synced, pending, or failed, recent or failed deployments, what is waiting for deployment, registry repos, and pending plan approvals./atlas-actionAtlas in CI/CD pipelines with the Atlas actions: ariga/setup-atlas and ariga/atlas-action on GitHub Actions, the GitLab CI components, the CircleCI orb, the Bitbucket pipe, and the Azure DevOps AtlasAction task. The CI/CD steps (migrate lint, push, diff, hash, autorebase, test, apply, down, set, drift; schema plan, plan approve, push, apply, lint, test; script exec, query, loop, test, push; security scan; monitor schema; create-repo) with its inputs, outputs, tokens, permissions, and pull request comments, plus pinning versions, runners, and fixing a failed run. Use with the atlas skill whenever a pipeline runs Atlas or an Atlas check in CI fails./atlas-clickhouseClickHouse specifics for Atlas: the login-only driver, dev database and URL scope (database vs server), Docker dev images and version checks, cluster mode and ON CLUSTER, table engines, sort keys and table rebuilds, plans that skip destructive changes without a terminal, table recreation and the allow_recreate policy, mutations and CH lint checks, materialized views, dictionaries, UDFs and WASM, named collections, users, roles, grants, row policies and settings profiles, secret settings and the sensitive mode, no transactions and no lock, ClickHouse Cloud, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a ClickHouse database./atlas-databricksDatabricks specifics for Atlas: the extended binary and login, connection URLs and scope (catalog vs schema), the dev catalog (no Docker), Delta table properties, managed and external tables, partitioning and liquid clustering, generated and identity columns, defaults and column mapping, renames, informational keys and checks, collations, column masks and row filters, views, metric views, and materialized views, SQL and Python functions, procedures, Unity Catalog grants, no transactions and no locks, partial failures, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a Databricks database. For Databricks Lakebase, use atlas-lakebase./atlas-mssqlSQL Server specifics for Atlas (also Azure SQL and MSSQL): login, Azure SQL sign-in with Microsoft Entra ID (fedauth, no password), dev database and URL scope (mode=schema vs mode=database, the database query parameter), compatibility level and collation, system-generated constraint names, clustered index defaults and datetime2 precision in HCL, GO batches and the delimiter directive, transactions and statements that cannot run in one, identity, computed and temporal columns, alias and table types, changes planned as a drop and an add, what Atlas leaves out (DENY, synonyms, row-level security, sparse columns), database roles, users and grants, schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a SQL Server or Azure SQL database./atlas-mysqlMySQL and MariaDB specifics for Atlas: dev database and URL scope (schema vs server), character sets and collations, users, roles and grants, enum and set columns, generated columns, foreign-key indexes, functional and prefix indexes, triggers and stored programs, table copies and MY lint checks, partial migration failures (no transactional DDL), GET_LOCK, managed services (RDS, Aurora, Cloud SQL, Azure), schema and migration tests, and custom lint rules. Use with the atlas skill whenever Atlas manages a MySQL or MariaDB database./atlas:atlas-lakebasefrom Atlas
npx claudepluginhub ariga/atlas --plugin atlasOther plugins' skills for the same job