Added simple types in param builder and ydbType#14
Added simple types in param builder and ydbType#141NepuNep1 merged 1 commit intoydb-platform:ydbfrom
Conversation
1NepuNep1
commented
Sep 26, 2025
There was a problem hiding this comment.
Pull Request Overview
Adds support for additional simple types to the Go code generator for YDB.
- Introduces handling for uuid and yson types in YDBType.
- Extends ydbBuilderMethodForColumnType to recognize serial* aliases and uuid/yson.
- Minor formatting inconsistency introduced in multi-type case list.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/codegen/golang/ydb_type.go | Added uuid and yson type mappings with pointer/nullability handling. |
| internal/codegen/golang/query.go | Added builder method mappings for serial/bigserial/smallserial/uuid/yson; adjusted switch cases. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| case "uuid": | ||
| if notNull { | ||
| return "uuid.UUID" | ||
| } | ||
| if emitPointersForNull { | ||
| return "*uuid.UUID" | ||
| } | ||
| return "*uuid.UUID" | ||
|
|
||
| case "yson": | ||
| if notNull { | ||
| return "[]byte" | ||
| } | ||
| if emitPointersForNull { | ||
| return "*[]byte" | ||
| } | ||
| return "*[]byte" |
There was a problem hiding this comment.
The second conditional in each block is redundant because both the conditional branch and the final return produce the same value; this can be simplified to reduce noise. Suggest rewriting each to only check notNull, then return the pointer form unconditionally for the nullable case, e.g.: case "uuid": if notNull { return "uuid.UUID" }; return "*uuid.UUID".
| case "uint16": | ||
| return "Uint16" | ||
| case "int16": | ||
| case "int16", "smallserial","serial2": |
There was a problem hiding this comment.
[nitpick] Inconsistent spacing after commas ("smallserial","serial2") compared to other multi-value case lines; add a space after the comma for readability and consistency: case "int16", "smallserial", "serial2":.
| case "int16", "smallserial","serial2": | |
| case "int16", "smallserial", "serial2": |