diff --git a/pgconn.go b/pgconn.go index 25f4f4d5..e3f3aaff 100644 --- a/pgconn.go +++ b/pgconn.go @@ -520,6 +520,11 @@ func (pgConn *PgConn) IsClosed() bool { return pgConn.status < connStatusIdle } +// IsBusy reports if the connection is busy. +func (pgConn *PgConn) IsBusy() bool { + return pgConn.status == connStatusBusy +} + // lock locks the connection. func (pgConn *PgConn) lock() error { switch pgConn.status {