Skip to content

fix(spansql): Support UUID as a base data type#14117

Open
adamhicks wants to merge 3 commits intogoogleapis:mainfrom
adamhicks:adam-adduuidtospansql
Open

fix(spansql): Support UUID as a base data type#14117
adamhicks wants to merge 3 commits intogoogleapis:mainfrom
adamhicks:adam-adduuidtospansql

Conversation

@adamhicks
Copy link
Copy Markdown

@adamhicks adamhicks commented Mar 4, 2026

Currently if we have this ddl statement

CREATE TABLE tname (id UUID) PRIMARY KEY (id)

and we run it through spansql like this:

out, _ := spansql.ParseDDL("", ddl)
ddl = out.List[0].SQL()

we end up with

CREATE TABLE tname (
  id `UUID`,
) PRIMARY KEY(id)

which can no longer be run against the database as the UUID data type has been mangled.

This change proposes to add UUID as a base type so that it can be recognised and retained through parsing.

@adamhicks adamhicks requested review from a team as code owners March 4, 2026 14:54
@product-auto-label product-auto-label bot added the api: spanner Issues related to the Spanner API. label Mar 4, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for the UUID data type in spansql, fixing an issue where the type was being mangled during parsing and serialization. The changes correctly introduce UUID as a base type, update the parser and SQL generator, and add corresponding tests. The existing comment in spanner/spannertest/funcs.go has been kept as it provides valid feedback for code clarity and consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: spanner Issues related to the Spanner API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant