Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: Use SQLx joins, fix WorkspaceBuildRBAC audit #6562

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

Closed
wants to merge 6 commits into from

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Mar 10, 2023

No description provided.

@sreya
Copy link
Collaborator

sreya commented Mar 10, 2023

@Emyrk could you maybe update the PR description with what problem this is solving? I'm trying to understand how badly we need joins. Introducing an alternative way to do queries that involves a custom generator seems like a lot of complexity for us to support just for a few queries. I'm wondering if we could maybe do something that's simpler even if it's way less elegant.

@Emyrk
Copy link
Member Author

Emyrk commented Mar 10, 2023

@Emyrk could you maybe update the PR description with what problem this is solving? I'm trying to understand how badly we need joins. Introducing an alternative way to do queries that involves a custom generator seems like a lot of complexity for us to support just for a few queries. I'm wondering if we could maybe do something that's simpler even if it's way less elegant.

Yes this is just reverting back in this PR.

See the original PR: #6429
And the issue: #6426

@sreya
Copy link
Collaborator

sreya commented Mar 10, 2023

It just seems like to me that the optimization is a bit premature. We're currently under 10 DB calls for a round trip which is practically nothing. Im just hesitant to introduce an alternate form of sql gen when I'm not aware of the status quo impeding us (even if it's not perfect). Do you think this is something we could kick down the road until it becomes a real issue?

@Emyrk
Copy link
Member Author

Emyrk commented Mar 10, 2023

It just seems like to me that the optimization is a bit premature. We're currently under 10 DB calls for a round trip which is practically nothing. Im just hesitant to introduce an alternate form of sql gen when I'm not aware of the status quo impeding us (even if it's not perfect). Do you think this is something we could kick down the road until it becomes a real issue?

This PR is not for performance. It is to enable using JOIN, which we can't really do. And it is to support dynamic queries so I can implement negated search queries: #6439. So you can search not x in the search (tbd syntax, github issues does -name:emyrk).

Right now without dynamic queries and joins, some things are difficult to implement cleanly. We have to double all our CASE WHEN clauses, or potentially even more. For authorized queries we do a strings.Replace on a sql comment.

Dynamic queries open up a lot of search behavior that we can also just no do right now. We cannot change sort order in sqlc.

@Emyrk
Copy link
Member Author

Emyrk commented Mar 10, 2023

Tabling until we need better search

@Emyrk Emyrk closed this Mar 10, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2023
@Emyrk Emyrk deleted the stevenmasley/workspace_build_audit branch April 17, 2023 20:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants