Open roycefanproxy opened 3 years ago
Model.create() does not seem to work with sqlalchemy.func object.
Model.create()
sqlalchemy.func
Currently I make use of crypt() and gen_salt() from pgcrypto extension to generate password hash. What I want to do is to create a user record as follow:
crypt()
gen_salt()
new_user = await User.create(email="example@example.com", password=func.crypt(pass_val, func.gen_salt('bf', 7)), **data)
Is my understanding of Model.create usage wrong or it's a bug, or a feature doesn't support yet?
Model.create
Right, this was not considered yet - I made it partially work a few days ago, but I'll need a few more weekends to make it hit production.
Description
Model.create()
does not seem to work withsqlalchemy.func
object.What I Did
Currently I make use of
crypt()
andgen_salt()
from pgcrypto extension to generate password hash. What I want to do is to create a user record as follow:Is my understanding of
Model.create
usage wrong or it's a bug, or a feature doesn't support yet?