Skip to content

Conversation

1NepuNep1
Copy link
Collaborator

@1NepuNep1 1NepuNep1 requested a review from Copilot October 2, 2025 12:29
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +172 to +188
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"
Copy link

Copilot AI Oct 2, 2025

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".

Copilot uses AI. Check for mistakes.

case "uint16":
return "Uint16"
case "int16":
case "int16", "smallserial","serial2":
Copy link

Copilot AI Oct 2, 2025

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":.

Suggested change
case "int16", "smallserial","serial2":
case "int16", "smallserial", "serial2":

Copilot uses AI. Check for mistakes.

@1NepuNep1 1NepuNep1 merged commit a69429c into ydb-platform:ydb Oct 8, 2025
12 checks passed
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.

1 participant