-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,7 +49,7 @@ func YDBType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Col | |
} | ||
// return "sql.NullInt16" | ||
return "*int16" | ||
case "int", "int32": //ydb doesn't have int type, but we need it to support untyped constants | ||
case "int", "int32": //ydb doesn't have int type, but we need it to support untyped constants | ||
if notNull { | ||
return "int32" | ||
} | ||
|
@@ -159,7 +159,7 @@ func YDBType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Col | |
return "*string" | ||
} | ||
return "*string" | ||
|
||
case "date", "date32", "datetime", "timestamp", "tzdate", "tztimestamp", "tzdatetime": | ||
if notNull { | ||
return "time.Time" | ||
|
@@ -169,6 +169,24 @@ func YDBType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.Col | |
} | ||
return "*time.Time" | ||
|
||
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" | ||
Comment on lines
+172
to
+188
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. Positive FeedbackNegative Feedback |
||
|
||
case "null": | ||
// return "sql.Null" | ||
return "interface{}" | ||
|
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":.
Copilot uses AI. Check for mistakes.