Add PgConn.IsBusy() method

This commit is contained in:
Jack Christensen 2019-10-12 10:21:33 -05:00
parent 0077ff0474
commit fcfd7d09a9

View File

@ -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 {