According https://github.com/go-gorm/gorm.io/issues/846, I try to using
_ = gorm.G[[]*UsersDB](db).Create(context.Background(), &[]*UsersDB{
{UserID: "1"},
{UserID: "2"},
})
_ = gorm.G[[]UsersDB](db).Create(context.Background(), &[]UsersDB{
{UserID: "3"},
{UserID: "4"},
})
The document you expected this should be explained
https://gorm.io/docs/create.html doesn't have any suggestions about Generics API
's creating multiple records
Expected answer
Which one is preferred? G[[]T](db)
or G[[]*T](db)
? And why?
Can you put it in https://github.com/go-gorm/gorm/blob/master/tests/generics_test.go