Closed Raj2032 closed 2 months ago
I could use a #[secondary_key] however the issue over here is that what if there are two rows that has the same customer name.
@Raj2032 That should not be a problem, because the secondary_key
is not unique by default (Could you provide more details about your original code/problem?). Thus, you can retrieve multiple entities by performing a scan of the secondary keys, see here.
That should not be a problem, because the secondary_key is not unique by default
My mistake, I was under the impression that secondary key is also unique, I checked out the docs and yeah makes sense.
Its a very interesting project and it looks like this might be the database I have been looking for, most other databases out there require you to type everything as a string when doing queries, other issues it doesn't integrate with Rust very well, data types are different to Rust. So yeah I am quite happy this is most likely the most appropriate database to use.
Will be closing this issue now.
Say I have this struct:
Issue is that if I wanted to search for the customer's name, it would be much slower as we have to go through every row, deserialize it and then determine if the customer's name is
"John"
for example.I could use a
#[secondary_key]
however the issue over here is that what if there are two rows that has the same customer name.I wanted to suggest something like
#[queryable]
or something like that in this example:something like this. More over to support nested structures: