-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple storage interface to PostgreSQL -- -- Simple storage interface to PostgreSQL @package pg-store @version 0.4.3 module Database.PostgreSQL.Store.Tuple -- | Generic product type data Tuple (ts :: [Type]) [Empty] :: Tuple '[] [Cons] :: t -> !(Tuple ts) -> Tuple (t : ts) appendElement :: AppendElement ts => Tuple ts -> t -> Tuple (ts |> t) -- | Helper class to extract an element from a Tuple. class HasElement (n :: Nat) (ts :: [Type]) r | n ts -> r -- | Extract the n-th element from the product. getElementN :: HasElement n ts r => Tuple ts -> Tagged n r -- | Extract the n-th element from the product. getElementN :: HasElement n ts r => Tuple ts -> Tagged n r -- | Extract element at index 0. getElement0 :: Tuple (r : ts) -> r -- | Extract element at index 1. getElement1 :: Tuple (t0 : (r : ts)) -> r -- | Extract element at index 2. getElement2 :: Tuple (t0 : (t1 : (r : ts))) -> r -- | Extract element at index 3. getElement3 :: Tuple (t0 : (t1 : (t2 : (r : ts)))) -> r -- | Extract element at index 4. getElement4 :: Tuple (t0 : (t1 : (t2 : (t3 : (r : ts))))) -> r -- | Extract element at index 5. getElement5 :: Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (r : ts)))))) -> r -- | Extract element at index 6. getElement6 :: Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (r : ts))))))) -> r -- | Extract element at index 7. getElement7 :: Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (r : ts)))))))) -> r -- | Extract element at index 8. getElement8 :: Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (t7 : (r : ts))))))))) -> r -- | Extract element at index 9. getElement9 :: Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (t7 : (t8 : (r : ts)))))))))) -> r -- | Build a function type using the given parameter types and return type. -- | A value of type r can be created using an instance of -- Tuple ts. type WithTuple ts r = ConsTuple '[] (Tuple ts -> r) (FunctionType ts r) -- | Collect values to construct a Tuple ts, then apply the given -- function to it. withTuple :: (WithTuple ts r) => (Tuple ts -> r) -> FunctionType ts r instance Database.PostgreSQL.Store.Tuple.ShowElement '[] instance (GHC.Show.Show t, Database.PostgreSQL.Store.Tuple.ShowElement ts) => Database.PostgreSQL.Store.Tuple.ShowElement (t : ts) instance Database.PostgreSQL.Store.Tuple.ShowElement ts => GHC.Show.Show (Database.PostgreSQL.Store.Tuple.Tuple ts) instance Database.PostgreSQL.Store.Tuple.HasElement 0 (t : ts) t instance (1 GHC.TypeLits.<= n, Database.PostgreSQL.Store.Tuple.HasElement (n GHC.TypeLits.- 1) ts r) => Database.PostgreSQL.Store.Tuple.HasElement n (t : ts) r instance Database.PostgreSQL.Store.Tuple.AppendElement '[] instance Database.PostgreSQL.Store.Tuple.AppendElement ts => Database.PostgreSQL.Store.Tuple.AppendElement (t : ts) instance Database.PostgreSQL.Store.Tuple.ConsTuple ts (Database.PostgreSQL.Store.Tuple.Tuple ts -> r) r instance (Database.PostgreSQL.Store.Tuple.AppendElement ts, Database.PostgreSQL.Store.Tuple.ConsTuple (ts Database.PostgreSQL.Store.Tuple.|> t) a r) => Database.PostgreSQL.Store.Tuple.ConsTuple ts a (t -> r) module Database.PostgreSQL.Store.Types -- | SQL statement newtype Statement a Statement :: ByteString -> Statement a -- | Query object data Query a Query :: ByteString -> [Maybe (Oid, ByteString, Format)] -> Query a -- | SQL statement [queryStatement] :: Query a -> ByteString -- | Parameters [queryParams] :: Query a -> [Maybe (Oid, ByteString, Format)] -- | Preparable query object data PrepQuery ts a PrepQuery :: ByteString -> ByteString -> [Oid] -> (Tuple ts -> [Maybe (ByteString, Format)]) -> PrepQuery ts a -- | Name of the prepared statement [prepName] :: PrepQuery ts a -> ByteString -- | SQL statement [prepStatement] :: PrepQuery ts a -> ByteString -- | Parameter type hints [prepOids] :: PrepQuery ts a -> [Oid] -- | Parameter generator [prepParams] :: PrepQuery ts a -> Tuple ts -> [Maybe (ByteString, Format)] -- | Attach Text tag. toParam :: ByteString -> (ByteString, Format) -- | Attach Text tag. toTypedParam :: Oid -> ByteString -> (Oid, ByteString, Format) newtype Oid :: * Oid :: CUInt -> Oid data Format :: * instance GHC.Show.Show (Database.PostgreSQL.Store.Types.PrepQuery ts a) instance GHC.Classes.Ord (Database.PostgreSQL.Store.Types.Query a) instance GHC.Classes.Eq (Database.PostgreSQL.Store.Types.Query a) instance GHC.Show.Show (Database.PostgreSQL.Store.Types.Query a) instance GHC.Classes.Ord (Database.PostgreSQL.Store.Types.Statement a) instance GHC.Classes.Eq (Database.PostgreSQL.Store.Types.Statement a) instance GHC.Show.Show (Database.PostgreSQL.Store.Types.Statement a) module Database.PostgreSQL.Store.RowParser -- | Consumes w columns of a result set row in order to produce an -- instance of a. data RowParser (w :: Nat) a -- | Location of an error data RowErrorLocation RowErrorLocation :: Column -> Row -> RowErrorLocation -- | Errors that occur during row parsing data RowErrorDetail -- | Underlying RowParser wants more columns than are currently -- present. TooFewColumns :: RowErrorDetail -- | A column value could not be parsed. ColumnRejected :: RowErrorDetail -- | An error that occured when parsing a row data RowError RowError :: RowErrorLocation -> RowErrorDetail -> RowError -- | Process the each row of the Result with the given -- RowParser. processResultWith :: forall a n. (KnownNat n) => Result -> RowParser n a -> ExceptT RowError IO [a] -- | Transform the result of another RowParser. Similar to monadic -- bind. Also keeps track of how many columns are needed in total. (>>=$) :: forall a v b w. (KnownNat v) => RowParser v a -> (a -> RowParser w b) -> RowParser (v + w) b infixl 1 >>=$ -- | Chain two RowParsers, but discard the result of the first. (>>$) :: forall a v b w. (KnownNat v) => RowParser v a -> RowParser w b -> RowParser (v + w) b infixl 1 >>$ -- | Just like the '(*)' operator. (<*>$) :: forall a v b w. (KnownNat v) => RowParser v (a -> b) -> RowParser w a -> RowParser (v + w) b infixl 4 <*>$ -- | Terminate the parsing tree by returning the final result. finish :: a -> RowParser 0 a -- | Terminate the parsing tree with an error. cancel :: RowErrorDetail -> RowParser 0 a -- | Skip a number of columns. skipColumns :: RowParser n () -- | Check if the following n columns are not NULL. nonNullCheck :: Int -> RowParser 0 Bool -- | Process the contents of a column. processContent :: (Oid -> Maybe ByteString -> Maybe a) -> RowParser 1 a -- | Retrieve a column's type and content. retrieveColumn :: RowParser 1 (Oid, Maybe ByteString) -- | Retrieve a column's content. retrieveContent :: RowParser 1 ByteString instance GHC.Classes.Ord Database.PostgreSQL.Store.RowParser.RowError instance GHC.Classes.Eq Database.PostgreSQL.Store.RowParser.RowError instance GHC.Show.Show Database.PostgreSQL.Store.RowParser.RowError instance GHC.Classes.Ord Database.PostgreSQL.Store.RowParser.RowErrorDetail instance GHC.Classes.Eq Database.PostgreSQL.Store.RowParser.RowErrorDetail instance GHC.Show.Show Database.PostgreSQL.Store.RowParser.RowErrorDetail instance GHC.Classes.Ord Database.PostgreSQL.Store.RowParser.RowErrorLocation instance GHC.Classes.Eq Database.PostgreSQL.Store.RowParser.RowErrorLocation instance GHC.Show.Show Database.PostgreSQL.Store.RowParser.RowErrorLocation instance GHC.Base.Functor (Database.PostgreSQL.Store.RowParser.RowParser w) module Database.PostgreSQL.Store.Query.Builder -- | Generator for queries, its type parameter hints the type needed to -- generate the attached values data QueryGenerator a Gen :: Oid -> (a -> Maybe ByteString) -> QueryGenerator a Code :: ByteString -> QueryGenerator a With :: (a -> b) -> (QueryGenerator b) -> QueryGenerator a Merge :: (QueryGenerator a) -> (QueryGenerator a) -> QueryGenerator a -- | Assemble the query object. assemble :: QueryGenerator a -> a -> Query r -- | Assemble for query preparation. assemblePrep :: ByteString -> QueryGenerator (Tuple p) -> PrepQuery p r -- | Embed a generator which requires an external parameter. withOther :: a -> QueryGenerator a -> QueryGenerator b -- | Insert an identifying name. Takes care of proper quotation. genIdentifier :: ByteString -> QueryGenerator a -- | Connect two identifiers with a dot. Each identifier is surrounded by -- quotes if necessary. genNestedIdentifier :: ByteString -> ByteString -> QueryGenerator a -- | Surround with quotes and escape delimiting characters. genQuote :: ByteString -> QueryGenerator a -- | Join multiple query generators with a piece of code. joinGens :: ByteString -> [QueryGenerator a] -> QueryGenerator a -- | Redirect the n-th parameter for the given query withParamN :: forall n r ts. (HasElement n ts r) => QueryGenerator r -> Tagged n (QueryGenerator (Tuple ts)) -- | Redirect the 0th paramter to the given query generator. withParam0 :: QueryGenerator r -> QueryGenerator (Tuple (r : ts)) -- | Redirect the 1st paramter to the given query generator. withParam1 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (r : ts))) -- | Redirect the 2nd paramter to the given query generator. withParam2 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (r : ts)))) -- | Redirect the 3rd paramter to the given query generator. withParam3 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (r : ts))))) -- | Redirect the 4th paramter to the given query generator. withParam4 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (r : ts)))))) -- | Redirect the 5th paramter to the given query generator. withParam5 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (r : ts))))))) -- | Redirect the 6th paramter to the given query generator. withParam6 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (r : ts)))))))) -- | Redirect the 7th paramter to the given query generator. withParam7 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (r : ts))))))))) -- | Redirect the 8th paramter to the given query generator. withParam8 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (t7 : (r : ts)))))))))) -- | Redirect the 9th paramter to the given query generator. withParam9 :: QueryGenerator r -> QueryGenerator (Tuple (t0 : (t1 : (t2 : (t3 : (t4 : (t5 : (t6 : (t7 : (t8 : (r : ts))))))))))) instance GHC.Base.Monoid (Database.PostgreSQL.Store.Query.Builder.QueryGenerator a) instance Data.Semigroup.Semigroup (Database.PostgreSQL.Store.Query.Builder.QueryGenerator a) instance Data.String.IsString (Database.PostgreSQL.Store.Query.Builder.QueryGenerator a) instance Data.Hashable.Class.Hashable (Database.PostgreSQL.Store.Query.Builder.QueryGenerator a) module Database.PostgreSQL.Store.Generics -- | Make sure a has a safe generic representation. Types that -- qualify implement Generic (GHC) and fulfill one of the -- following criteria: -- --
-- genCatSound :: QueryGenerator a -- genCatSound = Code "'meow'" -- -- listCats :: Query String -- listCats = -- [pgQuery| SELECT name -- FROM animals -- WHERE sound = $(genCatSound) |] ---- -- We inline the genCatSound generator which produces the SQL -- code 'meow'. As a result we have a query with this statement: -- --
-- SELECT * -- FROM animals -- WHERE sound = 'meow' ---- -- It is also possible to produce QueryGenerators with the -- pgQueryGen quasi quoter. -- --
-- genCatSound :: QueryGenerator a -- genCatSound = [pgQueryGen| 'meow' |] ---- -- pgQueryGen supports the same operations as pgQuery. -- --
-- listPeople :: Int -> Query String -- listPeople minimumAge = -- [pgQuery| SELECT name -- FROM people -- WHERE age > $minimumAge |] ---- -- This query will list the names of people above a given age. -- --
-- CREATE TABLE MyTable ( -- first INTEGER NOT NULL, -- second VARCHAR NOT NULL -- ) ---- -- We produce Haskell code like this: -- --
-- data MyTable = MyTable {
-- first :: Int,
-- second :: String
-- } deriving (Show, Eq, Ord, Generic)
--
-- instance Entity MyTable
--
-- instance TableEntity MyTable
--
--
-- Alternatively we can implement Entity and TableEntity
-- ourselves. In this case it is not needed.
--
-- We utilize these type classes in the following way:
--
-- -- listMyTable :: Query MyTable -- listMyTable = -- [pgQuery| SELECT #MyTable -- FROM @MyTable |] ---- -- We expand the absolute column names using #MyTable and the -- table name using @MyTable. This results in the following SQL: -- --
-- SELECT MyTable.first, MyTable.second -- FROM MyTable ---- -- Aliasing the table name is also possible: -- --
-- listMyTable :: Query MyTable -- listMyTable = -- [pgQuery| SELECT #MyTable(t) -- FROM @MyTable t |] ---- -- The alias is included in the resulting SQL: -- --
-- SELECT t.first, t.second -- FROM MyTable t --module Database.PostgreSQL.Store.Query.TH -- | Generate a QueryGenerator expression. -- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgQueryGen :: QuasiQuoter -- | Generate a Query. This utilizes an intermediate query generator -- of type QueryGenerator (). -- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgQuery :: QuasiQuoter -- | Generate a PrepQuery. The intermediate query generator has type -- QueryGenerator (Tuple ts) where ts has kind -- [Type]. ts represents the types of the parameters to -- this prepared query. -- -- It is highly recommended that supply a type signature, if you give the -- resulting expression a name, to avoid ambiguity. -- --
-- q :: PrepQuery '[Int, String] User -- q = [pgPrepQuery| SELECT #User(u) FROM @User u WHERE age < $(param0) AND name LIKE $(param1) |] ---- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgPrepQuery :: QuasiQuoter instance GHC.Classes.Ord Database.PostgreSQL.Store.Query.TH.QuerySegment instance GHC.Classes.Eq Database.PostgreSQL.Store.Query.TH.QuerySegment instance GHC.Show.Show Database.PostgreSQL.Store.Query.TH.QuerySegment -- | This module acts solely as a re-export unit. module Database.PostgreSQL.Store.Query module Database.PostgreSQL.Store.Errand -- | Error during errand data ErrandError -- | No Result has been returned. NoResult :: ErrandError -- | A user has thrown an error. UserError :: String -> ErrandError -- | Query execution failed. ExecError :: ExecStatus -> ErrorCode -> ByteString -> ByteString -> ByteString -> ErrandError -- | Result processing failed. ParseError :: RowError -> ErrandError -- | Error codes data ErrorCode UnknownErrorCause :: ByteString -> ErrorCode IntegrityViolation :: ErrorCode RestrictViolation :: ErrorCode NotNullViolation :: ErrorCode ForeignKeyViolation :: ErrorCode UniqueViolation :: ErrorCode CheckViolation :: ErrorCode ExclusionViolation :: ErrorCode -- | An interaction with the database data Errand a -- | Run an errand. runErrand :: Connection -> Errand a -> IO (Either ErrandError a) -- | Execute the query and return its internal result. execute :: (ErrandQuery q Result) => q r -> ErrandResult q Result -- | Same as execute but instead of a Result it returns the -- number of affected rows. execute' :: (ErrandQuery q Int) => q r -> ErrandResult q Int -- | Execute a query and process its result set. query :: (Entity r, ErrandQuery q [r]) => q r -> ErrandResult q [r] -- | Execute a query and process its result set using the provided -- RowParser. queryWith :: (ErrandQuery q [r], KnownNat n) => RowParser n r -> q r -> ErrandResult q [r] -- | Prepare a preparable query. prepare :: PrepQuery a r -> Errand () -- | Begin a transaction. beginTransaction :: Errand () -- | Commit transaction. commitTransaction :: Errand () -- | Create savepoint within transaction. saveTransaction :: ByteString -> Errand () -- | Roll back transaction. rollbackTransaction :: Errand () -- | Roll back to a specific savepoint. rollbackTransactionTo :: ByteString -> Errand () -- | Do something within a transaction. withTransaction :: Errand a -> Errand () -- | Identifies q as a query object. class ErrandQuery q r where type ErrandResult q r where { type family ErrandResult q r; } -- | Execute the query described in q x and pass its Result -- to the given function. executeWith :: ErrandQuery q r => (Result -> Errand r) -> q x -> ErrandResult q r instance Control.Monad.Error.Class.MonadError Database.PostgreSQL.Store.Errand.ErrandError Database.PostgreSQL.Store.Errand.Errand instance Control.Monad.IO.Class.MonadIO Database.PostgreSQL.Store.Errand.Errand instance GHC.Base.Alternative Database.PostgreSQL.Store.Errand.Errand instance GHC.Base.Monad Database.PostgreSQL.Store.Errand.Errand instance GHC.Base.Applicative Database.PostgreSQL.Store.Errand.Errand instance GHC.Base.Functor Database.PostgreSQL.Store.Errand.Errand instance GHC.Classes.Eq Database.PostgreSQL.Store.Errand.ErrandError instance GHC.Show.Show Database.PostgreSQL.Store.Errand.ErrandError instance GHC.Classes.Eq Database.PostgreSQL.Store.Errand.ErrorCode instance GHC.Show.Show Database.PostgreSQL.Store.Errand.ErrorCode instance GHC.Base.Monoid Database.PostgreSQL.Store.Errand.ErrandError instance Database.PostgreSQL.Store.Errand.ErrandQuery Database.PostgreSQL.Store.Types.Statement r instance Database.PostgreSQL.Store.Errand.ErrandQuery Database.PostgreSQL.Store.Types.Query r instance Database.PostgreSQL.Store.Tuple.WithTuple ts (Database.PostgreSQL.Store.Errand.Errand r) => Database.PostgreSQL.Store.Errand.ErrandQuery (Database.PostgreSQL.Store.Types.PrepQuery ts) r module Database.PostgreSQL.Store -- | An interaction with the database data Errand a -- | Run an errand. runErrand :: Connection -> Errand a -> IO (Either ErrandError a) -- | Execute the query and return its internal result. execute :: (ErrandQuery q Result) => q r -> ErrandResult q Result -- | Same as execute but instead of a Result it returns the -- number of affected rows. execute' :: (ErrandQuery q Int) => q r -> ErrandResult q Int -- | Execute a query and process its result set. query :: (Entity r, ErrandQuery q [r]) => q r -> ErrandResult q [r] -- | Execute a query and process its result set using the provided -- RowParser. queryWith :: (ErrandQuery q [r], KnownNat n) => RowParser n r -> q r -> ErrandResult q [r] -- | Prepare a preparable query. prepare :: PrepQuery a r -> Errand () -- | Begin a transaction. beginTransaction :: Errand () -- | Commit transaction. commitTransaction :: Errand () -- | Create savepoint within transaction. saveTransaction :: ByteString -> Errand () -- | Roll back transaction. rollbackTransaction :: Errand () -- | Roll back to a specific savepoint. rollbackTransactionTo :: ByteString -> Errand () -- | Do something within a transaction. withTransaction :: Errand a -> Errand () -- | Query object data Query a Query :: ByteString -> [Maybe (Oid, ByteString, Format)] -> Query a -- | SQL statement [queryStatement] :: Query a -> ByteString -- | Parameters [queryParams] :: Query a -> [Maybe (Oid, ByteString, Format)] -- | Preparable query object data PrepQuery ts a PrepQuery :: ByteString -> ByteString -> [Oid] -> (Tuple ts -> [Maybe (ByteString, Format)]) -> PrepQuery ts a -- | Name of the prepared statement [prepName] :: PrepQuery ts a -> ByteString -- | SQL statement [prepStatement] :: PrepQuery ts a -> ByteString -- | Parameter type hints [prepOids] :: PrepQuery ts a -> [Oid] -- | Parameter generator [prepParams] :: PrepQuery ts a -> Tuple ts -> [Maybe (ByteString, Format)] -- | Generate a Query. This utilizes an intermediate query generator -- of type QueryGenerator (). -- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgQuery :: QuasiQuoter -- | Generate a PrepQuery. The intermediate query generator has type -- QueryGenerator (Tuple ts) where ts has kind -- [Type]. ts represents the types of the parameters to -- this prepared query. -- -- It is highly recommended that supply a type signature, if you give the -- resulting expression a name, to avoid ambiguity. -- --
-- q :: PrepQuery '[Int, String] User -- q = [pgPrepQuery| SELECT #User(u) FROM @User u WHERE age < $(param0) AND name LIKE $(param1) |] ---- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgPrepQuery :: QuasiQuoter -- | Generate a QueryGenerator expression. -- -- See Database.PostgreSQL.Store.Query.TH for detailed description -- of the language accepted by this quasi quoter. pgQueryGen :: QuasiQuoter newtype Oid :: * Oid :: CUInt -> Oid -- | An entity that is used as a parameter or result of a query. class (KnownNat (Width a)) => Entity a where type Width a :: Nat type Width a = GEntityWidth (Rep a) genEntity = genGeneric parseEntity = parseGeneric where { type family Width a :: Nat; type Width a = GEntityWidth (Rep a); } -- | Embed the entity into the query. genEntity :: Entity a => QueryGenerator a -- | Embed the entity into the query. genEntity :: (Entity a, Generic a, GEntity (Rep a)) => QueryGenerator a -- | Retrieve an instance of a from the result set. parseEntity :: Entity a => RowParser (Width a) a -- | Retrieve an instance of a from the result set. parseEntity :: (Entity a, Generic a, GEntity (Rep a), Width a ~ GEntityWidth (Rep a)) => RowParser (Width a) a -- | Description of a table data Table Table :: ByteString -> [ByteString] -> Table -- | Table name [tableName] :: Table -> ByteString -- | Table columns [tableCols] :: Table -> [ByteString] -- | Table entity with extra information about its name and column names class (Entity a) => TableEntity a where describeTableType = describeGenericTable -- | Describe the table type. describeTableType :: TableEntity a => Tagged a Table -- | Describe the table type. describeTableType :: (TableEntity a, GenericTable a) => Tagged a Table -- | Error during errand data ErrandError -- | No Result has been returned. NoResult :: ErrandError -- | A user has thrown an error. UserError :: String -> ErrandError -- | Query execution failed. ExecError :: ExecStatus -> ErrorCode -> ByteString -> ByteString -> ByteString -> ErrandError -- | Result processing failed. ParseError :: RowError -> ErrandError -- | Error codes data ErrorCode UnknownErrorCause :: ByteString -> ErrorCode IntegrityViolation :: ErrorCode RestrictViolation :: ErrorCode NotNullViolation :: ErrorCode ForeignKeyViolation :: ErrorCode UniqueViolation :: ErrorCode CheckViolation :: ErrorCode ExclusionViolation :: ErrorCode data ExecStatus :: * -- | The string sent to the server was empty. EmptyQuery :: ExecStatus -- | Successful completion of a command returning no data. CommandOk :: ExecStatus -- | Successful completion of a command returning data (such as a SELECT or -- SHOW). TuplesOk :: ExecStatus -- | Copy Out (from server) data transfer started. CopyOut :: ExecStatus -- | Copy In (to server) data transfer started. CopyIn :: ExecStatus -- | Copy In/Out data transfer started. CopyBoth :: ExecStatus -- | The server's response was not understood. BadResponse :: ExecStatus -- | A nonfatal error (a notice or warning) occurred. NonfatalError :: ExecStatus -- | A fatal error occurred. FatalError :: ExecStatus -- | The PGresult contains a single result tuple from the current command. -- This status occurs only when single-row mode has been selected for the -- query. SingleTuple :: ExecStatus -- | An error that occured when parsing a row data RowError RowError :: RowErrorLocation -> RowErrorDetail -> RowError -- | Location of an error data RowErrorLocation RowErrorLocation :: Column -> Row -> RowErrorLocation -- | Errors that occur during row parsing data RowErrorDetail -- | Underlying RowParser wants more columns than are currently -- present. TooFewColumns :: RowErrorDetail -- | A column value could not be parsed. ColumnRejected :: RowErrorDetail