docs
Error Reference

Error Reference

All sentinel errors exported by gormicx. Use errors.Is for comparison.

import "errors"
 
err := db.Find(ctx, &User{}).First(&user)
if errors.Is(err, gormicx.ErrRecordNotFound) {
    // handle not found
}

Sentinel Errors

ErrorWhen raised
ErrRecordNotFoundFirst() finds no matching rows
ErrDuplicateKeyUnique constraint violation
ErrInvalidModelNon-pointer or non-struct passed as model
ErrMissingPKOperation requires a primary key but none is defined
ErrAlreadyCloseddb.Close() called more than once
ErrTxAlreadyDoneTransaction used after commit or rollback
ErrNilContextnil context passed to any operation
ErrEmptyBatchEmpty slice passed to CreateBatch or DeleteBatch
ErrUnsupportedOperation not supported by the driver (e.g. transactions on MongoDB)
ErrPoolExhaustedConnection pool full and request timed out