Why is AggregateBalance a reserved name for models?

@cyrus-za
Because if you create a model named Balance, theprisma client will try to generate an AggregateBalance type for aggregateApi which will conflict with AggregateBalance model.
https://github.com/prisma/prisma/blob/c36c1a7a84a5be3fd12522870a2f48cabdb6b833/src/packages/client/src/generation/generateClient.ts
https://github.com/prisma/prisma-engines/blob/b1c5396ac9832eb8481b3c7f36c393ab1747211d/libs/datamodel/core/src/transform/ast_to_dml/reserved_model_names.rs
There you can look at all deny model name list
Thanks. Just a little strange
Valid concern and we will see if we can find a way around this in some way.
@WellFail "Aggregate" is not actually on that list though, right?
@janpio
https://github.com/prisma/prisma/blob/c36c1a7a84a5be3fd12522870a2f48cabdb6b833/src/packages/client/src/generation/generateClient.ts#L615
Aggregate currently on this list and I see Aggregate${modelName} type in my generated prisma client.
The main problem is - If we have model AggregateBalance and Balance, prisma will generate AggregateAggregateBalance, AggregateBalance types for aggregation API and generate Balance type and AggregateBalance type for the base model type. These types will be conflicted with each other.
Maybe we can generate $Aggregate{name} types if there only this problem?
Yes, I can confirm this and the writeup @WellFail did is correct. We will need to prefix them as did for ${name}Client.
Ah, just looked at the Rust list.
We will look into if it is possible to remove this reserved name (as with many others).
Thanks, please tag me when this is fixed so I can switch my model name back
No promises this will happen any time soon - but it is a general thing we are trying to do.
This is fixed in the latest dev version - 2.12.0-dev.19 and will be shipped on latest next week Tuesday in our 2.12.0 release.
Most helpful comment
Ah, just looked at the Rust list.
We will look into if it is possible to remove this reserved name (as with many others).