Add actual row number to row number errors
This commit is contained in:
@@ -12,6 +12,7 @@ module Database.PostgreSQL.Opium.Connection
|
||||
) where
|
||||
|
||||
import Control.Concurrent.MVar (MVar, newMVar, modifyMVar_, withMVar)
|
||||
import Control.Exception (Exception)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Text (Text)
|
||||
import Database.PostgreSQL.LibPQ (ConnStatus (..))
|
||||
@@ -27,6 +28,8 @@ newtype Connection = Connection
|
||||
newtype ConnectionError = ConnectionError Text
|
||||
deriving (Show)
|
||||
|
||||
instance Exception ConnectionError
|
||||
|
||||
withRawConnection
|
||||
:: HasCallStack
|
||||
=> (Maybe LibPQ.Connection -> IO a)
|
||||
|
||||
@@ -17,8 +17,8 @@ data Error
|
||||
| ErrorInvalidOid Text Oid
|
||||
| ErrorUnexpectedNull ErrorPosition
|
||||
| ErrorInvalidField ErrorPosition Oid ByteString String
|
||||
| ErrorNotExactlyOneRow
|
||||
| ErrorMoreThanOneRow
|
||||
| ErrorNotExactlyOneRow Int
|
||||
| ErrorMoreThanOneRow Int
|
||||
| ErrorConnectionClosed
|
||||
deriving (Eq, Show)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user