diff --git a/pkg/sortby/random.go b/pkg/sortby/random.go index 0adbfa844..3a79a7b98 100644 --- a/pkg/sortby/random.go +++ b/pkg/sortby/random.go @@ -15,8 +15,12 @@ const ( func RandomExpr(dialect gorm.Dialect) *gorm.SqlExpr { switch dialect.GetName() { case MySQL: + // A seed integer can be passed as an argument, e.g. "RAND(2342)", to generate + // reproducible pseudo-random values, see https://mariadb.com/kb/en/rand/. return gorm.Expr("RAND()") case SQLite3: + // SQLite does not support specifying a seed to generate a deterministic sequence + // of pseudo-random values, see https://www.sqlite.org/lang_corefunc.html#random. return gorm.Expr("RANDOM()") default: return gorm.Expr("RAND()")