-
Notifications
You must be signed in to change notification settings - Fork 11
Custom type annotation #29
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
Comments
Hey, please see https://www.npmjs.com/package/prismabox/v/1.1.18-prerelease.0 I released a version under the @dev tag which you can install via npm. Please see if this is what you need! |
@m1212e on my codebase, i've noticed an issue with applying It's exactly the same And other than this case, it works exactly as i'd expected. Great and really helpful! And thank you a lot for a quick reaction! 🙏 |
Would you mind giving a full/more specific code example on that scenario? |
Hey, I'll close this for now, feel free to re-open if you want to continue on this! |
@m1212e sure! Unfortunately, i had no time to take a look into that branch recently, but I'll try with latest version soon and share an example here if something still doesn't seem right. And thanks for your support! |
Now it's possible to redefine of existing default types as @m1212e shown in #25 (comment).
But instead of overriding the default type mapping for all the strings for example (or all the dates, whatever), i'd like to be able to define a new type with custom transformation and use it just for a couple of fields in Prisma schema and keep the default type mapping for other fields.
E.g. if i extend Type with new type:
and then i'd like to apply this new custom type to a Prisma schema field via annotation:
It's supposed to be quite useful for BigInt type fields which are still not supported good enough in JSON and require transformation to string: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
Thanks in advance!
The text was updated successfully, but these errors were encountered: