-
Notifications
You must be signed in to change notification settings - Fork 1
Added simple types in param builder and ydbType #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1NepuNep1
commented
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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": |
Copilot
AI
Oct 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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": |