crates.io icon indicating copy to clipboard operation
crates.io copied to clipboard

controllers/version: Add traits to help reduce data loading

Open eth3lbert opened this issue 10 months ago • 1 comments

This PR primarily addresses three things:

  • Loading Crate and Version in a single query.
  • Adding helper traits to allow customization of the required columns to load and validation.
  • Avoiding loading the entire Crate when only Version 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 from Crate and Version, it would be nice to load only the necessary columns to reduce data loading.

Third, when only Version is required, it would be ideal to load only the ID of Crate to determine its existence.

I hope this doesn't overly complicate things :)

eth3lbert avatar Feb 17 '25 13:02 eth3lbert

Rebased and conflict resolved!

eth3lbert avatar Feb 25 '25 12:02 eth3lbert