Skip to content

Insert value generated by SQL func (crypt) and return model #343

Answered by stephenafamo
VRmnv asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you would have to use the query builder.

models.Users.Insert(
    im.Values(
        psql.Arg("[email protected]"),
        psql.Raw("crypt(?, gen_salt('bf'))", "password"),
    ),
)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@VRmnv
Comment options

Answer selected by VRmnv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants