You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prisma Client Python now comes bundled with a type validator, this makes it much easier to pass untrusted / untyped arguments to queries in a robust and type safe manner:
importprismafromprisma.typesimportUserCreateInputdefget_untrusted_input():
return {'points': input('Enter how many points you have: ')}
data=prisma.validate(UserCreateInput, get_untrusted_input())
awaitclient.user.create(data=data)
Any invalid input would then raise an easy to understand error (note: edited for brevity):
Enter how many points you have: a lot
Traceback:
pydantic.error_wrappers.ValidationError: 1 validation error for UserCreateInput
points
value is not a valid integer (type=type_error.integer)
Minor Changes
Improved supported for the windows platform (not officially supported yet)
This discussion was created from the release v0.2.1.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
New features
Support for case insensitive string filtering
This feature is only supported when using PostgreSQL and MongoDB.
Prisma Update
The internal Prisma binaries that Prisma Client Python uses have been upgraded from
2.30.0
to3.1.1
.This brings with it a lot of new features and improvements:
For a full list of changes see https://github.com/prisma/prisma/releases/tag/3.1.1 and https://github.com/prisma/prisma/releases/tag/3.0.1
Type Validator
Prisma Client Python now comes bundled with a type validator, this makes it much easier to pass untrusted / untyped arguments to queries in a robust and type safe manner:
Any invalid input would then raise an easy to understand error (note: edited for brevity):
Minor Changes
This discussion was created from the release v0.2.1.
Beta Was this translation helpful? Give feedback.
All reactions