{- |
Copyright : Flipstone Technology Partners 2023
License   : MIT
Stability : Stable

@since 1.0.0.0
-}
module Orville.PostgreSQL.Execution.QueryType
  ( QueryType (SelectQuery, InsertQuery, UpdateQuery, DeleteQuery, DDLQuery, CursorQuery, OtherQuery)
  )
where

{- |
  A simple categorization of SQL queries that is used to provide a hint to
  user callbacks about what kind of query is being run.

  See 'Orville.PostgreSQL.addSqlExecutionCallback'

@since 1.0.0.0
-}
data QueryType
  = SelectQuery
  | InsertQuery
  | UpdateQuery
  | DeleteQuery
  | DDLQuery
  | CursorQuery
  | OtherQuery
  deriving
    ( -- | @since 1.0.0.0
      Eq QueryType
Eq QueryType
-> (QueryType -> QueryType -> Ordering)
-> (QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> QueryType)
-> (QueryType -> QueryType -> QueryType)
-> Ord QueryType
QueryType -> QueryType -> Bool
QueryType -> QueryType -> Ordering
QueryType -> QueryType -> QueryType
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: QueryType -> QueryType -> Ordering
compare :: QueryType -> QueryType -> Ordering
$c< :: QueryType -> QueryType -> Bool
< :: QueryType -> QueryType -> Bool
$c<= :: QueryType -> QueryType -> Bool
<= :: QueryType -> QueryType -> Bool
$c> :: QueryType -> QueryType -> Bool
> :: QueryType -> QueryType -> Bool
$c>= :: QueryType -> QueryType -> Bool
>= :: QueryType -> QueryType -> Bool
$cmax :: QueryType -> QueryType -> QueryType
max :: QueryType -> QueryType -> QueryType
$cmin :: QueryType -> QueryType -> QueryType
min :: QueryType -> QueryType -> QueryType
Ord
    , -- | @since 1.0.0.0
      QueryType -> QueryType -> Bool
(QueryType -> QueryType -> Bool)
-> (QueryType -> QueryType -> Bool) -> Eq QueryType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: QueryType -> QueryType -> Bool
== :: QueryType -> QueryType -> Bool
$c/= :: QueryType -> QueryType -> Bool
/= :: QueryType -> QueryType -> Bool
Eq
    , -- | @since 1.0.0.0
      Int -> QueryType
QueryType -> Int
QueryType -> [QueryType]
QueryType -> QueryType
QueryType -> QueryType -> [QueryType]
QueryType -> QueryType -> QueryType -> [QueryType]
(QueryType -> QueryType)
-> (QueryType -> QueryType)
-> (Int -> QueryType)
-> (QueryType -> Int)
-> (QueryType -> [QueryType])
-> (QueryType -> QueryType -> [QueryType])
-> (QueryType -> QueryType -> [QueryType])
-> (QueryType -> QueryType -> QueryType -> [QueryType])
-> Enum QueryType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: QueryType -> QueryType
succ :: QueryType -> QueryType
$cpred :: QueryType -> QueryType
pred :: QueryType -> QueryType
$ctoEnum :: Int -> QueryType
toEnum :: Int -> QueryType
$cfromEnum :: QueryType -> Int
fromEnum :: QueryType -> Int
$cenumFrom :: QueryType -> [QueryType]
enumFrom :: QueryType -> [QueryType]
$cenumFromThen :: QueryType -> QueryType -> [QueryType]
enumFromThen :: QueryType -> QueryType -> [QueryType]
$cenumFromTo :: QueryType -> QueryType -> [QueryType]
enumFromTo :: QueryType -> QueryType -> [QueryType]
$cenumFromThenTo :: QueryType -> QueryType -> QueryType -> [QueryType]
enumFromThenTo :: QueryType -> QueryType -> QueryType -> [QueryType]
Enum
    , -- | @since 1.0.0.0
      QueryType
QueryType -> QueryType -> Bounded QueryType
forall a. a -> a -> Bounded a
$cminBound :: QueryType
minBound :: QueryType
$cmaxBound :: QueryType
maxBound :: QueryType
Bounded
    , -- | @since 1.0.0.0
      Int -> QueryType -> ShowS
[QueryType] -> ShowS
QueryType -> String
(Int -> QueryType -> ShowS)
-> (QueryType -> String)
-> ([QueryType] -> ShowS)
-> Show QueryType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> QueryType -> ShowS
showsPrec :: Int -> QueryType -> ShowS
$cshow :: QueryType -> String
show :: QueryType -> String
$cshowList :: [QueryType] -> ShowS
showList :: [QueryType] -> ShowS
Show
    , -- | @since 1.0.0.0
      ReadPrec [QueryType]
ReadPrec QueryType
Int -> ReadS QueryType
ReadS [QueryType]
(Int -> ReadS QueryType)
-> ReadS [QueryType]
-> ReadPrec QueryType
-> ReadPrec [QueryType]
-> Read QueryType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS QueryType
readsPrec :: Int -> ReadS QueryType
$creadList :: ReadS [QueryType]
readList :: ReadS [QueryType]
$creadPrec :: ReadPrec QueryType
readPrec :: ReadPrec QueryType
$creadListPrec :: ReadPrec [QueryType]
readListPrec :: ReadPrec [QueryType]
Read
    )