ErrRecordNotFound doesn't return an error? #6485
Replies: 1 comment
-
never mind, my database was locked and hence the query was failing. all works well |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, new to gorm here so this may be an obvious one to others: I am trying to check if a record already exists in the database before creating an object.
In my model. I have a BeforeCreate function that returns a uuid for the new row AFTER the following check:
However, what I find is that even with an empty database, there is no error generated on running the qyery. Is there a different way to check if the row already exists?
I am using sqllite, relevant entries in go.mod are:
Beta Was this translation helpful? Give feedback.
All reactions