Your Question
Is there an exist query like xorm?
exists, err = db.Exist(&RecordExist{
Name: "test1",
})
Thank you.
Comment From: li-jin-gou
Your Question
Is there an
existquery likexorm?
exists, err = db.Exist(&RecordExist{ Name: "test1", })Thank you.
hello @theprobugmaker it is none ~ you can use DB.RowsAffected to judge exists
Comment From: theprobugmaker
@li-jin-gou It would be nice to have a exists query as it would be executed on the database side instead of waiting for the return to judge based on rows affected.
I'd be happy to create a PR for that (if possible). I will study a little bit more the gorm code tho.
Thank you very much for answering.
Comment From: li-jin-gou
@li-jin-gou It would be nice to have a
existsquery as it would be executed on the database side instead of waiting for the return to judge based on rows affected. I'd be happy to create a PR for that (if possible). I will study a little bit more the gorm code tho. Thank you very much for answering.
:heart:
Comment From: zcyc
@theprobugmaker hi, have you pr for this issue?