Skip to content

Map MSSQL uniqueidentifier to google/uuid#436

Open
rosensama wants to merge 1 commit into
xo:mainfrom
rosensama:feat/sqlserver-uniqueidentifier
Open

Map MSSQL uniqueidentifier to google/uuid#436
rosensama wants to merge 1 commit into
xo:mainfrom
rosensama:feat/sqlserver-uniqueidentifier

Conversation

@rosensama

Copy link
Copy Markdown

Summary

  • MSSQL uniqueidentifier columns previously fell through SqlserverGoType to schemaType, generating a placeholder Uniqueidentifier struct name in user code.
  • Map them instead to uuid.UUID / uuid.NullUUID, mirroring the postgres uuid mapping at loader/postgres.go:165 and reusing the existing --uuid flag and import wiring (templates/go/go.go:143, :2194, :2034).
  • mssql.UniqueIdentifier (from github.com/microsoft/go-mssqldb) was considered but rejected to avoid introducing a new dependency when google/uuid is already available from the postgres path.

Fixes #435.

Tested against an MSSQL repro of the issue with a local build.

🤖 Generated with Claude Code

Previously fell through to schemaType, producing a bogus
`Uniqueidentifier` struct name. Map to uuid.UUID / uuid.NullUUID
to mirror the postgres uuid mapping and reuse the existing
--uuid flag and import wiring.

mssql.UniqueIdentifier (github.com/microsoft/go-mssqldb) was an
alternative, but we preferred not to introduce a new dependency
when google/uuid was already available from the postgres path.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSSQL uniqueidentifier column type not supported

1 participant