Covers Google Cloud Spanner-specific behavior when managing schemas with Atlas: dialects, emulator limitations, migration rules, partial failures, hotspot keys, and custom lint rules.
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.
Read when SKILL.md points to them.
What is specific to Google Cloud Spanner when Atlas manages the schema. The atlas skill covers the
workflows and commands; this skill covers the rules, edge cases, and answers that differ on Spanner. It
covers both dialects, GoogleSQL and PostgreSQL. Behavior was checked against the Spanner emulator
1.5.58 and Google's Spanner documentation.
This skill is SKILL.md plus seven reference files under references/, each served at
https://atlasgo.io/skills/atlas-spanner/references/<name>. Read a reference when the task needs it:
| File | Read it for |
|---|---|
references/dev-database.md | Scope and named schemas, docker://spanner and docker://spannerpg, what the emulator lacks, your own dev database on a real instance, URLs, credentials, and IAM, running an emulator by hand |
references/objects.md | What Atlas leaves out or plans differently, keys and hotspots, interleaving, type changes, indexes, foreign keys, checks and generated columns, sequences, views, change streams, TTL, named schemas, Enterprise features, the PostgreSQL dialect |
references/hcl.md | Writing the schema in HCL: HCL or SQL, STRING(MAX), generated columns and options, interleave, indexes, sequences, views, change streams, locality groups and placements, property graphs |
references/migrations.md | -- atlas:txmode none, partial failures and recovery, long-running changes and Google's limits, lint on Spanner, dependent objects, changes to write by hand, renames, data changes and mutation limits, the revisions table, baselines |
references/security.md | Database roles and grants, why they need a real Spanner dev database, DEFINER views, IAM bindings outside Atlas |
references/testing.md | Testing every change with migration tests, testing a declarative schema, what to seed, matching errors, CI |
references/custom-rules.md | Writing a custom lint rule in the HCL rule language: what Spanner objects expose, and tested rules for hotspot keys and indexes |
The atlas skill, installed next to this one (../atlas/SKILL.md). If it is missing, download
https://atlasgo.io/skills/atlas/SKILL.md to ../atlas/SKILL.md and each reference file listed in its
Files section to ../atlas/references/<name>.
The spanner driver is available only as custom build, install that build:
curl -sSf https://atlasgo.sh | ATLAS_FLAVOR="spanner" sh, or use the arigaio/atlas:latest-extended
image. Check the login with atlas whoami. If it shows no login, ask the user to run atlas login:
logged out, every command that connects to Spanner aborts with
The spanner driver is available only to Atlas Pro users. A user without an account can start a free
trial with atlas login.references/dev-database.md):
spanner://projects/<project>/instances/<instance>/databases/<database>. It carries no
credentials: Atlas uses Application Default Credentials (gcloud auth application-default login, or
the CI runner's service account).schema "default" in HCL, public in the
PostgreSQL dialect) and every named schema. A named schema the desired state leaves out is planned
for a drop: declare it, or limit the run with schemas, --schema, or exclude.migrate apply keeps its revisions table in the named schema atlas_schema_revisions, which a
declarative plan on the same database drops unless excluded.docker://spanner/<version> for GoogleSQL, or
docker://spannerpg/<version> for the PostgreSQL dialect. Pin a release, such as 1.5.58: latest is
whatever the machine pulled last. The emulator ignores roles and grants, treats placements as no-ops,
loses some locality group and vector index options, and does not enforce mutation limits. For roles
and grants, point dev at an empty database on a real Spanner instance. Never point dev at a real
environment's database.-- atlas:txmode none. atlas migrate diff writes it, but
atlas migrate new does not, and a hand-written file without it fails on the target with
cannot execute DDL as part of a transaction. migrate lint and migrate validate miss it;
migrate test catches it. atlas schema clean and atlas schema test fail with the same error on
Spanner: reset a database by applying an empty schema, and test with migration tests (Rule 12).atlas migrate hash, or undo the applied statements with atlas migrate down.
Statements that backfill or validate every row (CREATE INDEX on a populated table, NOT NULL, a
shorter STRING(n), a new foreign key or check, a stored generated column) run from minutes to
hours: keep them in small files of their own. Google advises at most 10 of them per batch and at
most 3 new backfilled indexes a day. Set the if_not_exists diff policy, so a rerun after a dead job
skips a statement Spanner finished (references/migrations.md).references/objects.md):
the keys of a table cannot change after table creation.STRING and BYTES: planning fails
with Cannot change type of column.NOT NULL column needs a DEFAULT, or planning fails with Cannot add NOT NULL column.ALTER TABLE ... RENAME TO ... by hand.
Columns cannot be renamed.references/objects.md, What Atlas Leaves Out):
INT64 without a generator, and a table without a primary key gets
a plain rowid key. Declare keys, and generate INT64 keys from a named bit-reversed sequence:
DEFAULT (GET_NEXT_SEQUENCE_VALUE(SEQUENCE OrderSeq)).NOT ENFORCED foreign keys become enforced, and interleaved indexes become global indexes. Write
both by hand.ALTER CHANGE STREAM by hand, and flag DROP CHANGE STREAM with a statement lint rule.STORING list, or view that uses it plans the
DROP COLUMN first, which Spanner rejects. migrate diff writes the file anyway; migrate lint
fails on it. Move the dependent change first and run atlas migrate hash
(references/migrations.md, Dependent Objects).INTERLEAVE IN, without PARENT, breaks inspection, and a sequence in a
named schema breaks planning.GENERATE_UUID(), or the UUID type with NEW_UUID()) or a bit-reversed
sequence, and enforce it with the custom rules in references/custom-rules.md.references/hcl.md): name files *.sp.hcl. Write sql("STRING(MAX)"), since STRING(MAX) is
not an HCL type. Always set type = IN_PARENT in an interleave block: without it Atlas writes
invalid DDL. A primary key with a descending part plans only from SQL: in HCL it plans
PRIMARY KEY (). There is no data block, renamed_from, or identity column. Declare vector indexes,
locality groups, and placements in HCL: a SQL schema loses their options on the emulator.references/security.md): enable them with
mode { roles = true, permissions = true }, and plan them on a dev database on a real Spanner
instance. Declare every grantee as a role: Spanner has no database users, and the user block plans
nothing. Which IAM principals may act as a role is an IAM binding outside Atlas.atlas script loop, or with Partitioned
DML outside Atlas. Seed rows go in migration files: there is no data block on Spanner
(references/migrations.md, Data Changes).atlas schema validate, lint the change
(atlas migrate lint, or the plan of atlas schema apply --dry-run), then write test "migrate"
cases: atlas schema test does not run on Spanner.
Seed rows for each change that validates data: NULLs before NOT NULL, long values before a
shorter STRING(n), duplicates and two NULLs before a unique index, orphans before a foreign key.
Run them with atlas migrate test. A declarative project tests through a throwaway migration
directory (references/testing.md).references/custom-rules.md).references/objects.md, PostgreSQL Dialect): plan on docker://spannerpg/<version>.
A TTL breaks planning, and a spanner.commit_timestamp column breaks every plan after the first.
numeric, jsonb, and float4 columns cannot be keys or be indexed.| Question | Answer |
|---|---|
| A local Spanner database to apply migrations to | atlas tool docker --url "docker://spanner/1.5.58" --name my-spanner prints its URL; atlas tool docker kill --name my-spanner stops it (references/dev-database.md) |
The spanner driver is available only as custom build | Install the extended build: curl -sSf https://atlasgo.sh | ATLAS_FLAVOR="spanner" sh (Rule 1) |
The spanner driver is available only to Atlas Pro users | Ask the user to run atlas login (Rule 1) |
credentials: could not find default credentials | Run gcloud auth application-default login, or give the runner a service account (references/dev-database.md) |
cannot execute DDL as part of a transaction from migrate apply | Add -- atlas:txmode none at the top of the file and run atlas migrate hash (references/migrations.md) |
cannot execute DDL as part of a transaction from schema test or schema clean | Neither runs on Spanner: write migration tests, and reset with an empty schema (Rule 4) |
the keys of a table cannot change after table creation | Create a new table with the new key, copy the rows, then drop the old one (references/objects.md) |
Adding or removing INTERLEAVE IN PARENT plans no change | Interleaving is permanent: create a new table and copy the rows (references/objects.md, Interleaving) |
Cannot change type of column `X` from `INT64` to `STRING` | Add a new column, backfill it, and drop the old one later (references/objects.md) |
Cannot add NOT NULL column ... to existing table | Give the new column a DEFAULT (references/objects.md) |
Cannot specify a null value for column when a column becomes NOT NULL | Backfill the NULL rows first: ALTER COLUMN does not use the default (references/objects.md) |
Reducing the length of column ... is not allowed | Shorten the longer values first; lint does not report this change (references/objects.md) |
Cannot drop column ... because it is used by index, or on which there are dependent views | Move the DROP INDEX or the view change above the DROP COLUMN (references/migrations.md, Dependent Objects) |
Requested change to key column ... could not be made | Interleaved children inherit the key column, so it cannot change (references/objects.md) |
Scan error on column index 3, name "on_delete_action" | A table uses INTERLEAVE IN without PARENT: convert it with ALTER TABLE ... SET INTERLEAVE IN PARENT ... through gcloud (references/objects.md, Interleaving) |
Duplicate name in schema or Duplicate column name on a rerun | The statement finished before the job died: set the if_not_exists policy, or remove the statement (references/migrations.md) |
A plan drops atlas_schema_revisions or another named schema | The URL covers every schema: declare it, or exclude it (references/dev-database.md, Scope) |
An identity column, a NOT ENFORCED foreign key, or an interleaved index is missing from the plan | Atlas leaves those clauses out: use a sequence, or write them by hand (references/objects.md) |
| A change stream is dropped and recreated | Write ALTER CHANGE STREAM ... SET OPTIONS or SET FOR by hand (references/migrations.md) |
| A renamed table shows up as a drop and a create | Write ALTER TABLE Old RENAME TO New, ADD SYNONYM Old by hand, after -- atlas:nolint DS102 BC103; in the declarative workflow, edit the plan with schema apply --edit (references/migrations.md, Renames) |
an error is expected, but none occurred from a catch on a SELECT | catch does not see query errors on Spanner: check with exec and output over INFORMATION_SCHEMA (references/testing.md, Matching Errors) |
Drop sequence "X": ... Sequence not found | The sequence is in a named schema: keep sequences in the default schema (references/objects.md) |
There is no type named "MAX" | Write sql("STRING(MAX)") (references/hcl.md) |
Syntax error ... Expecting 'IN' on an INTERLEAVE clause | Add type = IN_PARENT to the interleave block (references/hcl.md) |
A plan creates PRIMARY KEY () | An HCL primary key with on blocks: keep descending keys in a SQL schema (references/hcl.md) |
unknown block type data in spanner schema | Seed rows with INSERT statements in a migration file (references/migrations.md) |
Table not found: INFORMATION_SCHEMA.TABLE_PRIVILEGES | Roles and grants need a dev database on a real Spanner instance (references/security.md) |
modify index "X" must have at least one column to add or drop | A vector index: exclude it once it exists (references/objects.md, Indexes) |
cannot add and drop a column at the same time | Change one STORING column per migration (references/objects.md, Indexes) |
View `V` is missing the SQL SECURITY clause | Add SQL SECURITY INVOKER, or DEFINER (references/objects.md, Views) |
Expecting 'INVOKER' but found 'DEFINER' | Pin emulator 1.5.56 or later (references/dev-database.md) |
connected database is not clean: found schema "default". baseline version or allow-dirty is required | Create a baseline migration and pass --baseline (references/migrations.md, Existing Databases) |
BadUsage from a large UPDATE or DELETE | More than 80,000 mutations in one statement: batch it with atlas script loop, or use Partitioned DML (references/migrations.md) |
unsupported type on the PostgreSQL dialect | A spanner.commit_timestamp column (references/objects.md, PostgreSQL Dialect) |
is not supported in Spanner PostgreSQL dialect | Atlas cannot plan a PostgreSQL-dialect TTL: exclude the table (references/objects.md) |
Cannot reference PG.NUMERIC ... in the creation of index | PostgreSQL-dialect numeric, jsonb, and float4 columns cannot be indexed (references/objects.md) |
| A convention must hold on every table, such as hotspot-free keys | Write a custom lint rule (references/custom-rules.md) |
references/custom-rules.md (opens in a new tab)references/dev-database.md (opens in a new tab)references/hcl.md (opens in a new tab)references/migrations.md (opens in a new tab)references/objects.md (opens in a new tab)references/security.md (opens in a new tab)references/testing.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
google-cloud-spanner, atlas, schema-migration, database-devops
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:atlas-spannerfrom Atlas
npx claudepluginhub ariga/atlas --plugin atlasOther plugins' skills for the same job