Added backend
This commit is contained in:
9
backend/database/utils.go
Normal file
9
backend/database/utils.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package database
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
func Exists(tx *gorm.DB, query interface{}, args ...interface{}) bool {
|
||||
var exists bool
|
||||
tx.Where(query, args...).Select("count(*) > 0").Find(&exists)
|
||||
return exists
|
||||
}
|
||||
Reference in New Issue
Block a user