Skip to content
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

feat: FIR-44128 report column types in go sdk #131

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

stepansergeevitch
Copy link
Collaborator

Added types reporting for both inMemory and streaming rows.
For every column we now report

  • go-native type (reflect.Type)
  • database-native type name
  • is type nullable
  • type length (maxInt for text, bytea and array, 0 for all others)
  • precision/scale (non-zero for Decimal only)

@stepansergeevitch stepansergeevitch self-assigned this Mar 5, 2025
@stepansergeevitch stepansergeevitch requested a review from a team as a code owner March 5, 2025 15:13
@stepansergeevitch stepansergeevitch changed the title Fir 44128 report column types in go sdk feat: FIR-44128 report column types in go sdk Mar 5, 2025
Copy link

sonarqubecloud bot commented Mar 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
14.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

decimalPrefix = "Decimal("
numericPrefix = "numeric("
structPrefix = "struct("
suffix = ")"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the suffix name seems a little vague when seen in code, could you rename it to something like complexTypeSuffix or closingBracketSuffix?


type fireboltType struct {
goType reflect.Type
dbName string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call this dbType or it might be confused with database name.

Comment on lines +66 to +69
if r.columns[index].fbType.precision > 0 && r.columns[index].fbType.scale > 0 {
return r.columns[index].fbType.precision, r.columns[index].fbType.scale, true
}
return 0, 0, false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a valid case when scale is 0, but precision is > 0. Redundant obviously, as it would be better represented by a different type, but nevertheless could occur.

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.

3 participants