-
Notifications
You must be signed in to change notification settings - Fork 26
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
Support for CompoundUniqueInput #8
Comments
In my project, I don't really use the connect DTOs. But yes, it would be possible. However, I also just realize that it doesn't generate any ApiProperty or class validation decorators yet. Hence, for export class VendorChassisNumber {
@ApiProperty()
@IsNotEmpty()
@IsString()
vendor: string;
@ApiProperty()
@IsNotEmpty()
@IsString()
chassis_number: string;
}
export class ConnectBikeDto {
@ApiProperty({
required: false,
nullable: true,
})
@IsOptional()
@IsString()
id?: string;
@ApiProperty({
required: false,
nullable: true,
type: VendorChassisNumber,
})
@IsOptional()
@ValidateNested()
@Type(() => VendorChassisNumber)
vendor_chassis_number?: VendorChassisNumber;
} So, it seems a bit more complex at second glance. |
Well. For now I just keep in mind to always edit the connect DTO to fit my purpose. It would be a great help to have the generator do this, even if it does not include the API documentation right away. I really need to get more into your generator to understand how its working. Maybe I can implement it myself. :D |
I finally found some time to implement it. Can you please test it? https://www.npmjs.com/package/@brakebein/prisma-generator-nestjs-dto/v/1.17.0-beta0 |
With Prisma, for example if using postgres, you can use a compound of unique fields.
This schema:
produces the following connect-dto:
wheras it should be this, as it is in Prisma:
For now I am editing the DTO after the fact, although using prisma generate obviously overrides the field.
The text was updated successfully, but these errors were encountered: