VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Translate Like a Pro | 9940 — Google Cloud Spanner CLI Localization: SQL, Database Roles, Query Modes and Safe Output

Google Cloud Spanner CLI localization means translating instructional text for the `gcloud spanner` command group while protecting resource names, SQL statements, flags and the meaning of queries and transactions. Readers searching how to translate `gcloud spanner cli`, `databases execute-sql`, database-role permissions, query modes and localized SQL output need to understand that commands are not ordinary sentences: changing an identifier or a verb can change the operation.

This guide helps global technical writers, translators, cloud database developers and instructors explain Spanner administration and SQL access safely. It covers the project–instance–database hierarchy, interactive shell and one-shot execution, GoogleSQL versus PostgreSQL dialect considerations, query plan modes, strong or timestamp-bound reads, results formatting, Unicode and release QA. All examples are fictional and assume properly authorized training resources.

The first three checks are project, instance and database. Then determine whether a line only reads rows, requests a plan or could modify persistent data. Good localization never changes the target to suit the reader’s country, promises write permissions from a read-only role or calls an executing statement harmless simply because it appears in a help article.

At a glance: Spanner CLI translation rules

  • Protect project, instance, database, role, SQL, command options and timestamp literals.
  • Translate human explanations, warnings, user tasks and contextual descriptions.
  • Label GoogleSQL or PostgreSQL dialect and the intended shell.
  • Keep read-only queries separate from data-changing statements.
  • Validate query mode, selected snapshot, output type and security context.

Understand the operation before translating a single flag

1. Start with the project, instance and database hierarchy

A Google Cloud project contains resources subject to billing and identity controls. A Spanner instance is a provisioned service resource, and a database belongs to an instance. Their identifiers should not be translated inside copyable commands. A guide written in Hindi or Spanish can describe the hierarchy naturally while preserving the exact project’s spelling.

Give a fictitious project `reading-lab`, instance `classroom-1` and database `lessons`. Ask learners to place each identifier on a tree. If a student describes the instance as the database or assumes the translation locale chooses a project, revise the explanation before introducing SQL.

2. The `gcloud` namespace is executable syntax

The command group `gcloud spanner` and its subcommands are parsed by the Google Cloud CLI. Translate headings such as ‘Open a Spanner shell’ or ‘Execute a SQL query’ but never substitute translated keywords inside a code block. A command’s token sequence is a technical contract, not an English sentence that requires an idiomatic equivalent.

Teach code classification before live examples. Have learners identify the executable, service group, resource selector and optional flags. This protects the central meaning of a command even in languages whose word order differs substantially from English.

3. Distinguish `gcloud spanner cli` from `execute-sql`

The `gcloud spanner cli` command opens an interactive shell; `gcloud spanner databases execute-sql` performs a specified SQL operation from a CLI invocation. Although both provide SQL access, they differ in workflow, prompt behavior and how scripts are reviewed. A translated tutorial should name which experience the reader is using.

Use two fictional scenarios: a developer exploring a small test database interactively, and an instructor checking one read-only query from a scripted command. Explain why a prompt-oriented step should not be copied into a noninteractive shell without adaptation.

4. Identify the selected project explicitly

The global `–project` setting can direct an operation to a different Google Cloud project. The language of the tutorial does not choose a project; neither does the user’s country. When a page omits this context, the same short command may behave differently on two workstations.

Ask learners to inspect their approved project configuration and compare it with the fictional documentation map. The intended project should be explained before any database-level instruction. Avoid suggesting that readers try other projects until one works.

5. An instance name is not a display label

The `–instance` selector identifies a particular Spanner instance. It should not be translated, title-cased or changed to a friendlier nickname inside executable code. A misleading localized caption can make readers think a query targets a different cluster of resources than the command actually addresses.

Show `–instance=classroom-1` beside a sentence explaining that it points to a fictitious instance. The translator may change the sentence but not the literal identifier. A reviewer should compare code, diagram and expected output for consistency.

6. Database naming is a separate lookup

The positional database argument refers to a database within the selected instance. It is not a table name, a language code or an application schema. Distinguishing all of these nouns makes a Spanner guide easier to follow for people moving from another database product.

Use `lessons` as an imaginary database and `enrolments` as an imaginary table. Ask learners why these two values appear in different parts of a command or SQL statement. The exercise tests conceptual understanding, not memorization.

7. Authentication is not the same as permission

Signing into the Google Cloud CLI establishes identity context, but identity alone does not grant all operations. IAM and database roles may control which resources and actions are available. A translated document must preserve access prerequisites and avoid telling readers to solve errors by increasing privileges.

Describe a read-only class identity with permission to inspect a training database. An example that attempts schema changes should be presented as outside the lesson’s authorization. The right educational response is to explain the boundary.

8. `–database-role` is a literal authorization selector

The `–database-role` option can identify a Spanner database role assumed for an operation. The role name is part of an access contract. Translating the role name within the command can change or invalidate the intended access context.

Explain the difference between a friendly description such as ‘report reader’ and a concrete role identifier used by the database. The label can be translated; the installed role name must match the actual system. Reviewers should never infer a role from its translated nickname.

9. Read-only SQL begins with a question

A query tutorial should start from the question the reader wants answered and identify the table and expected result columns. The SQL is then a precise representation of that question. Translating only the accompanying prose without checking whether the SQL matches it is incomplete technical editing.

For example, a fictional reading project may ask for the `student_id` and `status` columns from `enrolments`. Explain the purpose in the target language, then ensure that the SQL identifiers remain literal and that no private data is used.

10. SQL keywords and schema identifiers need protection

SQL words such as `SELECT`, `FROM` and `WHERE`, together with table names, columns and parameters, are programming syntax. Localizing them as ordinary nouns inside a copyable query makes the text invalid or changes its meaning. Human explanations can describe each clause separately.

Have learners mark schema identifiers in a sample query and translate only its surrounding description. Ask a technical reviewer to check that the selected fields correspond to the stated question, especially when a sentence describes a filtered subset.

11. Spanner supports more than one SQL dialect

Spanner databases may use GoogleSQL or PostgreSQL dialect choices. A translation cannot assume that all SQL examples have identical syntax across these environments. A phrase that calls a dialect-specific feature universal may mislead a reader even if the example looks familiar.

State which dialect the training database uses and point readers to the matching syntax reference. When translating a guide from a different environment, preserve the selected dialect rather than silently rewriting operators or identifier quoting.

12. A shell example has its own quoting layer

Commands passed to `–sql` first pass through the operating system’s shell before the Spanner client receives them. Bash, PowerShell and other shells have different quoting rules. A translated article should label the shell used in examples and avoid typographical substitutions that alter command parsing.

Compare a single-quoted SQL string in a Unix-style shell with a prose sentence containing smart quotes. Editors should keep straight quotes inside code, review line wrapping and avoid inserting translated punctuation into the command.

13. Query mode changes what is returned

The `–query-mode` option on `execute-sql` can distinguish normal results from query-plan and profiling information. Modes such as `NORMAL`, `PLAN` and `PROFILE` should be treated as exact enumerated values, not words to translate. A plan-only operation should not be described as returning application records.

Teach learners to predict whether the output is rows, a plan or diagnostic statistics for the chosen mode. A translation is misleading if a paragraph promises rows while the code asks only for a plan.

14. Plans are explanations of execution, not guarantees

A query plan describes how a database intends to perform work under particular conditions. It is not a permanent contract that all later executions will use identical steps or timings. Translating a plan explanation should preserve uncertainty, especially when statistics and workload change.

Give a fictional output showing two possible access methods and ask learners to distinguish the planner’s evidence from a benchmark. Do not replace a cautious technical statement with a guarantee that one query is always faster.

15. Profiling and normal execution have different evidence

Profiling may include plan details and runtime statistics beyond ordinary query rows. These fields are diagnostic and can depend on execution context. A technical writer should explain the extra evidence without implying that every user has the same performance or a universal latency figure.

Ask students to identify which facts can be learned from query text alone and which require measured execution. The translation should preserve that distinction so a support reader knows what evidence is missing.

16. Strong reads and timestamp-bound reads have distinct semantics

Spanner query interfaces may specify strong reads or a particular read timestamp. These choices affect the snapshot of data visible to the operation. They should not be reduced to informal labels like ‘latest’ versus ‘old’ without explaining the underlying read-time condition.

Present a small timeline with a fictional event created at one moment and a query at another. Ask which snapshot a timestamp-bound read requests. Preserve the timestamp and its time zone exactly in technical examples.

17. The timestamp is not a translated date decoration

Database read timestamps are precise technical inputs; changes in time-zone interpretation or formatting can shift the requested snapshot. Localized date presentation for a human is a different task from supplying an ISO-style timestamp in a CLI flag.

Have an editor display the same instant for two locales in explanatory prose while keeping the machine timestamp unchanged. Require a reviewer to check offset information and whether the chosen bound is valid for the operation.

18. DML is not harmless just because it is SQL

SQL may read, insert, update or delete records. A guide using `execute-sql` must classify the statement by effect before presenting it as an exercise. An innocent-looking terminal command can perform persistent changes when its SQL is mutating.

Write one read-only `SELECT` learning objective and contrast it with an `UPDATE` statement described conceptually. Keep actual write operations out of general introductory copy-and-paste samples unless a disposable environment and explicit approval are documented.

19. Partitioned DML needs its own explanation

The `–enable-partitioned-dml` flag is associated with a particular execution mode for appropriate data-changing statements. It must not be presented as a simple formatting option or a way to speed every query. Its effects and applicability require specialist review.

Translate a caution that operations modifying many rows deserve explicit scope and transaction review. Keep the flag literal and avoid including it casually in an example intended to demonstrate safe data inspection.

20. The interactive prompt is part of the user experience

An interactive shell displays a prompt and accepts successive statements. Localizing prompt explanations, keyboard guidance and expected outputs can make a tutorial welcoming, but the actual prompt options and control characters should remain exact where copied.

Show a plain-language explanation of entering a read-only query and leaving the shell. Clarify which text is typed and which text is displayed by the program. A screenshot with an ambiguous prompt can otherwise lead readers to copy output as input.

21. Format selection is not SQL filtering

Spanner CLI output may have human-readable and alternative display options, while `gcloud` also has global formatting conventions for supported commands. A localized guide must distinguish formatting a result from filtering rows in SQL. Hiding a column on screen is not the same as enforcing data access restrictions.

Ask learners to compare `SELECT` columns with the visible output columns and determine at which layer each selection happens. Use fictional records so no sensitive data enters publication screenshots.

22. Preserve the difference between empty and failed

An empty query result can mean no rows matched the conditions, while an authentication error, wrong database or invalid SQL means the query did not complete as expected. A translated error message that calls both ‘no data’ hides the evidence needed for troubleshooting.

Provide two fictional outputs, one successful with zero rows and one containing an error. Have students describe next steps without claiming data is missing or changing permissions until the actual failure stage is understood.

23. Distinguish a client timeout from a SQL result

A CLI timeout is a limit on how long a client waits for a request, not a translated estimate of database performance. The `–timeout` setting should be described as an execution-control option, and readers should understand that a timeout message does not establish whether every related operation was safely rolled back.

An exercise compares a slow read-only query and a completed query with empty rows. Ask learners which result requires further evidence. Avoid claiming that increasing the timeout will automatically improve the query plan or solve permissions errors.

24. Preserve priorities as enumerated choices

Query priority options such as high, medium and low are operational values where supported by the Spanner CLI. These strings are exact parameter values and may affect scheduling, but they do not guarantee a specific completion order or latency. Localized prose should explain the intent without inventing an absolute service promise.

Show a fictional training request using a low-priority background task. Ask readers to preserve the literal value while expressing its purpose naturally in the target language. A technical reviewer should confirm option support before any sample is called executable.

25. Separate database roles from IAM roles

Cloud IAM permissions and Spanner database roles can operate at distinct levels. A guide that treats them as synonyms can mislead a learner about what an identity is allowed to do. When a source discusses both, define each before shortening the terminology.

Draw a two-level permission map: access to a Google Cloud resource and privileges inside a database. Have learners explain why being able to discover a database does not necessarily authorize reading every table. This clarifies errors without suggesting privilege escalation.

26. Explain database dialect before showing punctuation

GoogleSQL and PostgreSQL dialect choices affect SQL syntax, identifiers and supported constructs. Even simple-looking examples can mislead if the source and target environments differ. The translator’s job is not to rewrite the application schema but to identify the dialect that makes the example valid.

Prepare a glossary card naming the chosen dialect and its official reference. A technical editor should check identifier quoting, parameter syntax and type examples rather than assuming a generic SQL tutorial applies unchanged.

27. Keep schema names and table names stable

Database identifiers such as `enrolments`, `student_id` and `status` may resemble ordinary words, but copyable SQL uses them as exact references. The natural-language labels on a training screen can be translated without renaming those columns in an existing database.

Ask learners to annotate a query with two different colors: SQL schema names and reader-facing explanation. A successful revision changes the explanation’s language while leaving the schema contract aligned with the sample data.

28. Avoid revealing real customer rows

Database examples can expose names, addresses, identifiers and confidential records through command output. A public article should use synthetic rows that are clearly labeled invented. A visually clean screenshot is not proof that the data may be published.

Build a small made-up classroom table with anonymized columns and values. Ask a privacy reviewer to check every column and screenshot, including alt descriptions. The article’s educational purpose does not justify copying production records into the CMS.

29. A result’s row count is not a performance metric

A statement that returns two rows may have scanned more data to find them, and a large-looking result is not automatically inefficient. Translations should distinguish the number of rows displayed, rows processed and execution characteristics reported by a query plan or profile.

Provide two fictional query descriptions with identical output sizes but different filters. Ask learners what cannot be inferred from the visible rows alone. This encourages evidence-based language rather than simplistic claims about speed.

30. Timestamp examples need a defined time zone

An exact read timestamp can identify a database snapshot. If a translator changes offset notation or silently converts to local wall time, the new text might no longer refer to the same instant. Dates in a human-oriented explanation and timestamps in CLI options serve different purposes.

Give an illustrative UTC timestamp and ask two readers in different countries to describe the same instant. Preserve the machine token while allowing localized date wording outside code. Check daylight-saving assumptions rather than guessing.

31. Plan output should not be described as application data

With query modes that return plans or execution details, the terminal may show operators, stages or statistics instead of the table rows a reader requested. This is useful for learning how queries work, but it does not answer the original data question in the same way.

Have students label columns from a hypothetical plan output as diagnostic metadata. The explanatory heading should say ‘inspect query plan’ rather than ‘list customer records’. Changing the heading is a meaningful correction, not a cosmetic edit.

32. Interactive mode and batch mode require different instructions

An interactive session receives successive commands and can retain context until it exits. A one-shot `execute-sql` invocation is usually organized around a single operation and a defined result. Translation should make input, output and stopping conditions clear for each mode.

Ask a reader to explain which command starts the interactive shell and which sends SQL as an argument. If the instructions imply that a prompt symbol is typed into the batch command, revise the example’s visual design.

33. Prevent accidental multiline command corruption

A code block can be broken by a publishing system or by the translation editor inserting line wraps, smart quotes or other punctuation. A multiline SQL statement inside shell quotes has extra parsing boundaries beyond the SQL syntax itself.

Review rendered code on narrow screens and copy it to a plain-text buffer without executing writes. Compare ASCII quotes, semicolons and line continuation characters to a validated source. A screen reader description should also distinguish typed input from output.

34. Clarify when the command connects to a service

`gcloud spanner` operations interact with cloud resources rather than a purely local text file. A guide should identify network, project and permission assumptions. This matters because an example that seems like local experimentation may have real billing or data implications.

Place a clear preparation note before remote commands and distinguish offline syntax reading from authorized service requests. A reader should know whether a step uses the local CLI only or asks Spanner to perform an operation.

35. Do not recommend broad permissions to remove an error

Insufficient permission is information about access control, not an invitation to bypass it. A professional troubleshooting guide explains the missing scope and directs readers to the approved administrator or policy owner. It should not say that every reader must receive an owner role.

Write a scenario with a read-only student trying a mutating statement. Ask what should change: the identity’s role or the tutorial’s learning objective? For a beginner guide, changing the exercise to an authorized read-only one is often safer.

36. Recognize that SQL errors can have several causes

A syntax error, table-not-found response, permission denial, unsupported dialect construct and transaction conflict are different failures. Translating each as ‘Spanner is unavailable’ hides the evidence needed for correction and can lead to improper support decisions.

Give learners a diagnostic sequence: identify resource scope, dialect, SQL syntax, table name, authorization and any time-bound read settings. They should state what the error actually shows before proposing a specific fix.

37. Transactions deserve honest language

Distributed transactional databases offer defined consistency and retry behavior, but a localized guide should not claim that all statements are automatically safe to rerun or that a partially observed action always had no effect. The exact operation and client behavior matter.

Use a fictional read-only transaction to introduce the concept of a consistent view, then discuss write retries only at a conceptual level. Mark any examples involving data modification as requiring application-specific engineering review.

38. Avoid misleading comparisons with other SQL clients

Spanner CLI, PostgreSQL `psql`, MySQL `mysql` and other shells may look similar while differing in authentication, features, options and service semantics. Translating a Spanner article by copying another client’s instructions can make a page superficially familiar but technically wrong.

Ask a reviewer to inspect one example for product-specific flags, role handling and output modes. A local-language adaptation should preserve Spanner’s own documented behavior rather than importing a convenient analogy without its limitations.

39. Build a compact terminology register

A terminology register should distinguish project, instance, database, table, database role, IAM role, query, transaction, read timestamp, plan, profile and output format. Some items have exact command tokens; others describe concepts. The register prevents the same target-language word from standing for conflicting layers.

Include one line for what can be translated and one for what must remain literal. Use the register across headings, code captions, questions and glossary entries, not only in the introduction.

40. Create a safe classroom read example

A beginner can learn much from a synthetic database without being authorized to modify any real tables. Present a fictional `enrolments` table and ask for a read-only selection of two non-sensitive columns, with an explicit instruction to use an approved sandbox if any real execution is attempted.

The student should first explain the SQL in ordinary language, then identify the instance and database in the CLI invocation. This reverse explanation tests understanding better than asking for blind copying.

41. Build a query-mode comparison workshop

Show three questions: What rows does the query return? What plan could execute it? What statistics were observed during execution? Relate them to normal, plan and profiling modes where supported. Make the learner predict the type of evidence each mode is intended to provide.

A translation repair exercise deliberately labels a plan as ‘the definitive database result’. Learners must correct it and explain why a diagnostic display is not the same thing as application records.

42. Run a read-timestamp reasoning exercise

Construct a fictional timeline in which an event is created, another event is updated and a later query specifies a snapshot time. Ask which state the snapshot represents. The exercise reinforces that a timestamp is a selection criterion, not merely how the terminal displays a date.

Translate the instructions into two languages while preserving the example’s exact instant. Have readers compare explanations and identify any accidental time-zone shift.

43. Record what was tested and what was not

A translation QA statement should distinguish reference-checked syntax from commands executed in a disposable authorized environment. It should also distinguish measured output from illustrative output that merely demonstrates format. Honesty about evidence is a crucial part of technical accuracy.

Record the CLI version, dialect, shell, project scope, database role, date and test result. A reviewer should be able to trace each factual assertion without needing access to private credentials.

44. Validate the live article’s code and layout

CMS rendering can modify quotes or wrap commands in ways that interfere with copying. Translation expansion can also change reading order, tables and placement of warnings. Test the published page on a small display, and verify links to the current official documentation.

Copy code fragments into a text buffer, compare exact flags and ensure that human-language notes do not appear inside executable lines. This catches content errors that a normal prose review misses.

45. Give each reviewer a defined responsibility

A bilingual editor checks clarity and cultural meaning, a database engineer verifies SQL and CLI semantics, a security reviewer checks permissions and data exposure, and an educator confirms the steps are understandable. A single enthusiastic proofreader cannot reliably replace these different forms of expertise.

Create a signoff table that records which command was checked, the claim it supports, the reviewer and the remaining limitation. An open question is more useful than a fabricated guarantee.

46. Keep the reader’s next question narrow

The article should teach how to translate Spanner CLI guidance safely, not pretend to cover database design, performance tuning, disaster recovery and every language’s technical grammar. Those topics require their own distinct explanations and primary evidence.

Link to the exact Spanner command reference and suggest readers choose a specialized guide for deeper tasks. This respects their search intent and keeps the translation library organized around real reader problems.

47. Finish with a decision the reader can make

After studying the guide, a reader should be able to identify a project, instance, database, role, dialect, query type and expected output before translating an example. They should also recognize a risky mutation and know when to seek a technical review.

Ask the reader to explain one command aloud without showing its SQL first. When the explanation and the actual statement match, the document is doing its educational job.

Worked example: a multilingual analyst onboarding handout

A research organization wants to teach analysts in five countries to inspect one small Spanner training database. The source material mixes a shell prompt, a sample `SELECT`, a query plan screenshot, a database role and a timestamp. The translation team first separates the code tokens from the prose, identifies the imaginary project and instance, and specifies that the lesson is read-only. The bilingual editor drafts natural instructions while the Spanner reviewer confirms which flags exist and which SQL dialect the sample assumes.

One version translates the database role’s identifier into a descriptive phrase and can no longer select the intended role. Another converts a UTC timestamp to the local date without retaining the actual instant. A third calls plan output ‘fetched customer records’. These are repaired by protecting literal tokens, documenting timestamp semantics and distinguishing diagnostic metadata from rows. The page becomes clearer because each correction removes a misleading assumption rather than simply adding more terminology.

Before publication, learners are asked to find the project, instance, database and role in a command; explain whether the SQL reads or changes data; identify whether the output is rows or plan statistics; and state which snapshot a timestamp-bound read requests. The last exercise asks them to say what they cannot conclude from an empty result or a timeout. This produces a much stronger understanding than a dictionary of flags alone.

Frequently asked questions

Does `gcloud spanner cli` mean the same thing as `execute-sql`?

No. One enters an interactive SQL shell; the other sends an explicitly supplied SQL operation through a CLI command. Translate the user experience accordingly.

Can I translate table and column names inside SQL?

Not unless the actual database schema was separately changed under an approved migration. Keep identifiers literal in code while translating their explanations.

Does `PLAN` return the requested table rows?

It is a query-plan mode, not the ordinary row-result mode. Describe the kind of evidence the user will see.

Is a successful login enough to query any table?

No. Resource IAM and database roles or privileges can restrict actions. Guide the reader to the authorized scope.

Should timestamps be converted for local readers?

Human explanations may show a familiar local date, but machine timestamp literals must preserve the same instant and relevant offset semantics.

Does an empty result mean the database is broken?

No. An executed query can return zero matching rows; that differs from a failed connection, permission denial or syntax error.

Official references and next reading

A professional translation is successful when a reader in another language understands what the same command targets, what it may change, which evidence it returns and which questions it leaves unanswered. For a powerful cloud SQL client, those distinctions are more important than fluent wording alone.