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
missing features - select and include query fields is missing #8
Comments
I think for language like dart to support like this feature we should create a new methods for each existing prisma method but has select and include fields and all it is output fields nullable we could also use the same method but make all output field late |
The simplest support solution might be to not deserialize the model, but return the Map type, but this is contrary to the original intention of Prisma. We need to wait for the new version of Dart grammar, union types have been proposed in Dart Language: dart-lang/language#83 Before that, we want to support include and selected It may only return map type data, if you want to deserialize the model, you must get the support of the union type. Currently our union type in the input phase is a very plain design and adds complexity to passing parameters. |
@Ali1Ammar I think we can remove model deserialization and just traverse child members to resolve We can discuss this and invite more users to vote. |
I could 3 solution for this return a map:
make all field a late and only set what we receive:
make all field nullable
we could apply one of this for all the existing methods 1- prisma.user.selectInclude.create(...);
2- prisma.user.createWithInclude(...); this new method will have all its output fields nullable |
Why don't we create a new branch to experiment with it? An experimental version is then released for users to choose from. If we want to support type safety well and complete the Either we do not query the relationship and just return the table fields to support type safety as we do now. Either give up type safety and use a Map or a new method that returns a Map. Personally I don't think it's a good idea to create a new method that makes it difficult for users to choose. |
|
select
andinclude
query fields is not included in the dmmf so our code doesn't generate itwe should found a way to support it
The text was updated successfully, but these errors were encountered: