Quramy / prisma-fabbrica

Prisma generator to define model factory

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot create a record with a column of required Decimal type

nioi-sugoi opened this issue · comments

Hi, thank you for a great library!
This library has made me very comfortable writing prisma tests, but I have one request.

When I try to create a record with required Decimal type, Not support Decimal field generation error occurs.

It seems to be caused by getScalarFieldValueGenerator().Decimal() being executed in autoGenerateTABLE_NAMEOrEnums function even if the target Decimal column is explicitly given a value.

There seems to be no escape hatch that prevents auto generate Decimal scalar data.

In the case of a required Decimal column, could you please add a change like that a scalar data is not automatically generated and must be explicitly given a value , for example?

I don't implement default auto value generator for Decimal type, but it can be configured .

Please check out https://github.com/Quramy/prisma-fabbrica#custom-scalar-field-generation .

@Quramy
Sorry, I missed this feature.

My problem solved, thank you for your reply.