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

Update to use a type of String to make queries #1651

Merged
merged 2 commits into from
Aug 18, 2023

Conversation

aindriu-aiven
Copy link
Contributor

About this change - What it does
This change uses a string for the approving team comparison as the kafka connector and topic requests have a string type for appronving team, but an integer type for the teamId
Resolves: #xxxxx
Why this way
This allows the queries to run against the H2 and postgres (and other dbs)

Tested this against a local postgres and local H2

Long topicApprovalCount =
topicRequestsRepo.countRequestorsTopicRequestsGroupByStatusType(
teamId, tenantId, requestor, RequestStatus.CREATED.value);
teamId, Integer.toString(teamId), tenantId, requestor, RequestStatus.CREATED.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to have a different teamId in the second argument here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I dont think so, the teamId is the requestors teamId and so is retriving the statistics for all topics/connector requests they are able to approve, and that aligns with what we return to the UI in terms of the connectors themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you have another scenario I'm not thinking of though let me know!

Copy link
Contributor

@muralibasani muralibasani left a comment

Choose a reason for hiding this comment

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

LGTM, thx

@aindriu-aiven aindriu-aiven merged commit b441218 into main Aug 18, 2023
21 checks passed
@aindriu-aiven aindriu-aiven deleted the issue-incorrect-type-used-in-db-query branch August 18, 2023 13:05
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.

2 participants