-
-
Notifications
You must be signed in to change notification settings - Fork 524
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
large composite key table #1294
large composite key table #1294
Comments
Hey @meowser, thanks for asking! Yes, the hard limit is 6 composite primary key. As a temporary solution, you can pick up to 6 columns to be the composite primary key. And leave other as ordinary columns. I'll create a PR to bump the limit up to 10 this afternoon. Then, you can point your |
Somewhat related: |
thanks! |
Hey @tyt2y3, I want your opinion on this. Currently, we have two similar list constructed in Enum: The Dataflow
The ConcernAs the size of tuple increased, the Enum implementation waste more memory space. Because the memory size of a Enum is determined by its largest variant. pub enum ValueTuple {
One(Value),
Two(Value, Value),
Three(Value, Value, Value),
Four(Value, Value, Value, Value),
Five(Value, Value, Value, Value, Value),
Six(Value, Value, Value, Value, Value, Value),
Seven(Value, Value, Value, Value, Value, Value, Value),
Eight(Value, Value, Value, Value, Value, Value, Value, Value),
Nine(Value, Value, Value, Value, Value, Value, Value, Value, Value),
Ten(Value, Value, Value, Value, Value, Value, Value, Value, Value, Value),
} The memory needed to store The ProposalWe can swap the storage from Enum to However, it will open a hole where an empty |
Just a random thought: is it possible to add feature configurations to enum variants? Such that 7-10 is only compiled conditionally if you ask for it? |
Still, this isn't attacking the fundamental problem of it. And I think it's not a good use of feature hahaa. |
True :D |
Yeah it started from a tuple of three which I think is the ideal size. I don't want basic usage to be penalized, so potentially it can look like: enum ValueTuple {
One(Value),
Two(Value, Value),
Three(Value, Value, Value),
Many(Vec<Value>),
} |
Discussed in #1293
Originally posted by meowser December 9, 2022
I have a table I am working with which has a very large composite primary key. When I auto-generate a model using sea-orm-cli the created model causes the following error:
Here is an example of the model:
I notice if I take out one of the primary key attributes my code will compile, so I believe there is an six column primary key limit. I was wondering what would be the best approach for dealing with tables like this since I have quite a few tables with long composite keys, which I cannot change?
The text was updated successfully, but these errors were encountered: