From 388e9b50db924d5dd5d6e260e80f55d43cebbfc4 Mon Sep 17 00:00:00 2001 From: Alex Lyashko Date: Tue, 4 Jul 2023 13:55:33 -0400 Subject: [PATCH] Add generic error for serialiase/lock-timeout errors These are quite generic errors and drivers can translate into it. --- errors.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/errors.go b/errors.go index cd76f1f5..96e5c071 100644 --- a/errors.go +++ b/errors.go @@ -49,4 +49,8 @@ var ( ErrDuplicatedKey = errors.New("duplicated key not allowed") // ErrForeignKeyViolated occurs when there is a foreign key constraint violation ErrForeignKeyViolated = errors.New("violates foreign key constraint") + // ErrLockTimeout occurs when a statement timed outs while waiting for row or table locks. + ErrLockTimeout = errors.New("lock wait timeout") + // ErrSerialisationFailure occurs when SERIALIZABLE tx can not be serialised with some other tx + ErrSerialisationFailure = errors.New("TX can not be serialized") )