Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

controllers/version: Add traits to help reduce data loading#10603

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
eth3lbert wants to merge5 commits intorust-lang:main
base:main
Choose a base branch
Loading
frometh3lbert:crate-and-version

Conversation

eth3lbert
Copy link
Contributor

@eth3lberteth3lbert commentedFeb 17, 2025
edited
Loading

This PR primarily addresses three things:

  • LoadingCrate andVersion in a single query.
  • Adding helper traits to allow customization of the required columns to load and validation.
  • Avoiding loading the entireCrate when onlyVersion is needed.

First, I assume that in most cases, the given inputs are valid, then it would be great to load them in a single query.

Second, since most endpoints do not require all columns fromCrate andVersion, it would be nice to load only the necessary columns to reduce data loading.

Third, when onlyVersion is required, it would be ideal to load only the ID ofCrate to determine its existence.

I hope this doesn't overly complicate things :)

@eth3lberteth3lbert added C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature works C-internal 🔧Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labelsFeb 17, 2025
Instead of loading them individually, this gets both in one query.I think that in most cases, the request to query for `Crate` and`Version` will have valid input, so this seems like a better approach,even though it might only give a small performance boost.
…`crate_and_version()` fnSince most endpoints don't need all of the columns for `crates` and`versions`, it would be great to only load the columns we actually needto make things faster.This will enable other endpoints to use the function to make a basequery and customize the needed columns.
@eth3lbert
Copy link
ContributorAuthor

Rebased and conflict resolved!

Copy link
Member

@Turbo87Turbo87 left a comment

Choose a reason for hiding this comment

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

I'm somewhat unsure whether the extra complexity is worth it.@LawnGnome any opinions?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Turbo87Turbo87Turbo87 left review comments

Assignees
No one assigned
Labels
A-backend ⚙️C-enhancement ✨Category: Adding new behavior or a change to the way an existing feature worksC-internal 🔧Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@eth3lbert@Turbo87

[8]ページ先頭

©2009-2025 Movatter.jp