Skip to content

Passing func type argument to Model.create does not work as expect  #736

Open

Description

@roycefanproxy
  • GINO version: 1.0.1
  • Python version: 3.8
  • asyncpg version: 0.21
  • PostgreSQL version: 12.4

Description

Model.create() does not seem to work with sqlalchemy.func object.

What I Did

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:

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?

Activity

  1. fantix commented on Dec 7, 2020

    @fantix
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions