Closed Zk2u closed 2 months ago
#[charybdis_model(
table_name = channels,
partition_keys = [participant], // place channel IDs of the same participant together
clustering_keys = [],
global_secondary_indexes = [],
local_secondary_indexes = [],
static_columns = []
)]
/// Represents a channel that a participant is in
pub struct ChannelEntry {
pub id: Uuid,
pub participant: Uuid,
}
With this I can find_by_participant
. Maybe a bug when have both PK and CK?
Wow never got this. It looks like you have to put fields in struct in order you define it in primary keys.
In our app there are 30 models, but looks like they already follow correct order as I never had this issue.
For now you can just use correct order:
pub struct ChannelEntry {
pub participant: Uuid,
pub id: Uuid,
}
and
pub struct Meal {
pub chef: Uuid,
pub id: Uuid,
...
}
I'm pretty sure this should be possible, but I have a table:
I'm pretty sure I should be able to look up all meals by a chef, but for some reason I cannot do so?