You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sold on the name. We should come up with a better one.
A question that periodically comes up is "my Queryable struct uses all but one column from my table. How do I do this?"
In crates.io we have the following:
/// We literally never want to select `textsearchable_index_col`/// so we provide this type and constant to pass to `.select`typeAllColumns = (
crates::id,
crates::name,
crates::updated_at,
crates::created_at,
crates::downloads,
crates::description,
crates::homepage,
crates::documentation,
crates::readme,
crates::readme_file,
crates::license,
crates::repository,
crates::max_upload_size,);pubconstALL_COLUMNS:AllColumns = (
crates::id,
crates::name,
crates::updated_at,
crates::created_at,
crates::downloads,
crates::description,
crates::homepage,
crates::documentation,
crates::readme,
crates::readme_file,
crates::license,
crates::repository,
crates::max_upload_size,);implCrate{pubfnall() -> diesel::dsl::Select<crates::table,AllColumns>{
crates::table.select(ALL_COLUMNS)}}
This seems like a reasonable pattern to derive in Diesel. I'd want to pull this into a trait though so the type and constant can become an associated type and associated constant. I think I'd also want to call them UsedColumns.
The text was updated successfully, but these errors were encountered:
Not sold on the name. We should come up with a better one.
A question that periodically comes up is "my
Queryable
struct uses all but one column from my table. How do I do this?"In crates.io we have the following:
This seems like a reasonable pattern to derive in Diesel. I'd want to pull this into a trait though so the type and constant can become an associated type and associated constant. I think I'd also want to call them
UsedColumns
.The text was updated successfully, but these errors were encountered: