You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (s *baseImpl[T]) UpdateWithTxById(ctx context.Context, tx bun.IDB, id string, m *T) error {
var (
logger = log.WithCtx(ctx)
)
_, err := tx.NewUpdate().Model(m).Where(whereIDTmpl, id).Returning("*").Exec(ctx)
if err != nil {
logger.Error(err.Error(), zap.Any("model", m))
return err
}
go rd.HSet(commontil.CopyContext(ctx), *m)
return err
}
func (s *baseImpl[T]) InsertWithTx(ctx context.Context, tx bun.IDB, m *T) error {
var (
logger = log.WithCtx(ctx)
)
_, err := tx.NewInsert().Model(m).Exec(ctx)
if err != nil {
logger.Error(err.Error(), zap.Any("model", m))
return err
}
go rd.HSet(commontil.CopyContext(ctx), *m)
return err
}
I get error when insert/update concurrency in transaction. But no more error when i change to sequential.
Error message when use pgdriver: unexpected message 'T'
With pgxpool driver: bad connection
The text was updated successfully, but these errors were encountered:
Hi @Tiscs , I found the cause of this issue. I'm using newest version. The error sometimes will come when I not add method .Returning or add .Returning("*"), sometimes it works well, and no more error when I add .Returning("NULL") to disable returning, but I really need to return all columns for the common case.
I get error when insert/update concurrency in transaction. But no more error when i change to sequential.
Error message when use pgdriver: unexpected message 'T'
With pgxpool driver: bad connection
The text was updated successfully, but these errors were encountered: