You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package ngorm
|
|
|
|
import (
|
|
"gorm.io/gen"
|
|
"gorm.io/gen/field"
|
|
"gorm.io/plugin/optimisticlock"
|
|
)
|
|
|
|
func ScopeVersionWhere(versionField field.Field, version optimisticlock.Version) func(gen.Dao) gen.Dao {
|
|
return func(dao gen.Dao) gen.Dao {
|
|
return dao.Where(versionField.Eq(version))
|
|
}
|
|
}
|