packages feed

persistent 2.17.1.0 → 2.18.0.0

raw patch · 74 files changed

+19191/−4051 lines, 74 files

Files

ChangeLog.md view
@@ -1,5 +1,10 @@ # Changelog for persistent +# 2.18.0.0++* [#1610](https://github.com/yesodweb/persistent/pull/1610)+  * Added `NoAction` as a `CascadeAction` + # 2.17.1.0  * [#1601](https://github.com/yesodweb/persistent/pull/1601)
Database/Persist.hs view
@@ -9,84 +9,105 @@ -- -- If you intend on using a SQL database, then check out "Database.Persist.Sql". module Database.Persist-    (--- * Defining Database Models------ | @persistent@ lets you define your database models using a special syntax.--- This syntax allows you to customize the resulting Haskell datatypes and--- database schema. See "Database.Persist.Quasi" for details on that definition--- language.+    ( -- * Defining Database Models --- ** Reference Schema & Dataset------ | For a quick example of the syntax, we'll introduce this database schema, and--- we'll use it to explain the update and filter combinators.------ @--- 'share' ['mkPersist' 'sqlSettings', 'mkMigrate' "migrateAll"] ['persistLowerCase'|--- User---     name String---     age Int---     deriving Show--- |]--- @------ This creates a Haskell datatype that looks like this:------ @--- data User = User---     { userName :: String---     , userAge :: Int---     }---     deriving Show--- @------ In a SQL database, we'd get a migration like this:------ @--- CREATE TABLE "user" (---      id    SERIAL PRIMARY KEY,---      name  TEXT NOT NULL,---      age   INT NOT NULL--- );--- @------ The examples below will refer to this as dataset-1.------ #dataset#------ > +-----+-----+-----+--- > |id   |name |age  |--- > +-----+-----+-----+--- > |1    |SPJ  |40   |--- > +-----+-----+-----+--- > |2    |Simon|41   |--- > +-----+-----+-----++    -- -        -- * Database Operations+      -- | @persistent@ lets you define your database models using a special syntax.+      -- This syntax allows you to customize the resulting Haskell datatypes and+      -- database schema. See "Database.Persist.Quasi" for details on that definition+      -- language.++      -- ** Reference Schema & Dataset++    --++      -- | For a quick example of the syntax, we'll introduce this database schema, and+      -- we'll use it to explain the update and filter combinators.+      --+      -- @+      -- 'share' ['mkPersist' 'sqlSettings', 'mkMigrate' "migrateAll"] ['persistLowerCase'|+      -- User+      --     name String+      --     age Int+      --     deriving Show+      -- |]+      -- @+      --+      -- This creates a Haskell datatype that looks like this:+      --+      -- @+      -- data User = User+      --     { userName :: String+      --     , userAge :: Int+      --     }+      --     deriving Show+      -- @+      --+      -- In a SQL database, we'd get a migration like this:+      --+      -- @+      -- CREATE TABLE "user" (+      --      id    SERIAL PRIMARY KEY,+      --      name  TEXT NOT NULL,+      --      age   INT NOT NULL+      -- );+      -- @+      --+      -- The examples below will refer to this as dataset-1.+      --+      -- #dataset#+      --+      -- > +-----+-----+-----++      -- > |id   |name |age  |+      -- > +-----+-----+-----++      -- > |1    |SPJ  |40   |+      -- > +-----+-----+-----++      -- > |2    |Simon|41   |+      -- > +-----+-----+-----+++      -- * Database Operations+       -- | The module "Database.Persist.Class" defines how to operate with-        -- @persistent@ database models. Check that module out for basic-        -- operations, like 'get', 'insert', and 'selectList'.+      -- @persistent@ database models. Check that module out for basic+      -- operations, like 'get', 'insert', and 'selectList'.       module Database.Persist.Class+       -- * Types+       -- | This module re-export contains a lot of the important types for       -- working with @persistent@ datatypes and underlying values.     , module Database.Persist.Types        -- * Query Operators+       -- | A convention that @persistent@ tries to follow is that operators on       -- Database types correspond to a Haskell (or database) operator with a @.@       -- character at the end. So to do @a || b@ , you'd write @a '||.' b@. To        -- ** Query update combinators+       -- | These operations are used when performing updates against the database.       --  Functions like 'upsert' use them to provide new or modified values.-    , (=.), (+=.), (-=.), (*=.), (/=.)+    , (=.)+    , (+=.)+    , (-=.)+    , (*=.)+    , (/=.)        -- ** Query filter combinators+       -- | These functions are useful in the 'PersistQuery' class, like       -- 'selectList', 'updateWhere', etc.-    , (==.), (!=.), (<.), (>.), (<=.), (>=.), (<-.), (/<-.), (||.)+    , (==.)+    , (!=.)+    , (<.)+    , (>.)+    , (<=.)+    , (>=.)+    , (<-.)+    , (/<-.)+    , (||.)        -- * JSON Utilities     , listToJSON@@ -98,19 +119,23 @@     , limitOffsetOrder     ) where -import Data.Aeson (toJSON, ToJSON)+import Data.Aeson (ToJSON, toJSON) import Data.Aeson.Text (encodeToTextBuilder) import qualified Data.Text as T import Data.Text.Lazy (toStrict) import Data.Text.Lazy.Builder (toLazyText) -import Database.Persist.Types import Database.Persist.Class import Database.Persist.Class.PersistField (getPersistMap)+import Database.Persist.Types  infixr 3 =., +=., -=., *=., /=.-(=.), (+=.), (-=.), (*=.), (/=.) ::-  forall v typ.  PersistField typ => EntityField v typ -> typ -> Update v+(=.)+    , (+=.)+    , (-=.)+    , (*=.)+    , (/=.)+        :: forall v typ. (PersistField typ) => EntityField v typ -> typ -> Update v  -- | Assign a field a value. --@@ -132,7 +157,6 @@ -- > +-----+-----+--------+ -- > |2    |Simon|41      | -- > +-----+-----+--------+- f =. a = Update f a Assign  -- | Assign a field by addition (@+=@).@@ -153,8 +177,6 @@ -- > +-----+-----+---------+ -- > |2    |Simon|41       | -- > +-----+-----+---------+-- f +=. a = Update f a Add  -- | Assign a field by subtraction (@-=@).@@ -175,7 +197,6 @@ -- > +-----+-----+---------+ -- > |2    |Simon|41       | -- > +-----+-----+---------+- f -=. a = Update f a Subtract  -- | Assign a field by multiplication (@*=@).@@ -196,8 +217,6 @@ -- > +-----+-----+--------+ -- > |2    |Simon|41      | -- > +-----+-----+--------+-- f *=. a = Update f a Multiply  -- | Assign a field by division (@/=@).@@ -218,12 +237,16 @@ -- > +-----+-----+---------+ -- > |2    |Simon|41       | -- > +-----+-----+---------+- f /=. a = Update f a Divide  infix 4 ==., <., <=., >., >=., !=.-(==.), (!=.), (<.), (<=.), (>.), (>=.) ::-  forall v typ.  PersistField typ => EntityField v typ -> typ -> Filter v+(==.)+    , (!=.)+    , (<.)+    , (<=.)+    , (>.)+    , (>=.)+        :: forall v typ. (PersistField typ) => EntityField v typ -> typ -> Filter v  -- | Check for equality. --@@ -241,8 +264,7 @@ -- > +-----+-----+-----+ -- > |1    |SPJ  |40   | -- > +-----+-----+-----+--f ==. a  = Filter f (FilterValue a) Eq+f ==. a = Filter f (FilterValue a) Eq  -- | Non-equality check. --@@ -260,7 +282,6 @@ -- > +-----+-----+-----+ -- > |2    |Simon|41   | -- > +-----+-----+-----+- f !=. a = Filter f (FilterValue a) Ne  -- | Less-than check.@@ -279,8 +300,7 @@ -- > +-----+-----+-----+ -- > |1    |SPJ  |40   | -- > +-----+-----+-----+--f <. a  = Filter f (FilterValue a) Lt+f <. a = Filter f (FilterValue a) Lt  -- | Less-than or equal check. --@@ -298,8 +318,7 @@ -- > +-----+-----+-----+ -- > |1    |SPJ  |40   | -- > +-----+-----+-----+--f <=. a  = Filter f (FilterValue a) Le+f <=. a = Filter f (FilterValue a) Le  -- | Greater-than check. --@@ -317,8 +336,7 @@ -- > +-----+-----+-----+ -- > |2    |Simon|41   | -- > +-----+-----+-----+--f >. a  = Filter f (FilterValue a) Gt+f >. a = Filter f (FilterValue a) Gt  -- | Greater-than or equal check. --@@ -336,11 +354,12 @@ -- > +-----+-----+-----+ -- > |2    |Simon|41   | -- > +-----+-----+-----+--f >=. a  = Filter f (FilterValue a) Ge+f >=. a = Filter f (FilterValue a) Ge  infix 4 <-., /<-.-(<-.), (/<-.) :: forall v typ.  PersistField typ => EntityField v typ -> [typ] -> Filter v+(<-.)+    , (/<-.)+        :: forall v typ. (PersistField typ) => EntityField v typ -> [typ] -> Filter v  -- | Check if value is in given list. --@@ -374,7 +393,6 @@ -- > +-----+-----+-----+ -- > |1    |SPJ  |40   | -- > +-----+-----+-----+- f <-. a = Filter f (FilterValues a) In  -- | Check if value is not in given list.@@ -393,7 +411,6 @@ -- > +-----+-----+-----+ -- > |2    |Simon|41   | -- > +-----+-----+-----+- f /<-. a = Filter f (FilterValues a) NotIn  infixl 3 ||.@@ -424,7 +441,7 @@ -- -- will filter records where a person's age is between 25 and 30 /and/ -- (person's category is either 1 or 5).-a ||. b = [FilterOr  [FilterAnd a, FilterAnd b]]+a ||. b = [FilterOr [FilterAnd a, FilterAnd b]]  -- | Convert list of 'PersistValue's into textual representation of JSON -- object. This is a type-constrained synonym for 'toJsonText'.@@ -438,16 +455,17 @@  -- | A more general way to convert instances of `ToJSON` type class to -- strict text 'T.Text'.-toJsonText :: ToJSON j => j -> T.Text+toJsonText :: (ToJSON j) => j -> T.Text toJsonText = toStrict . toLazyText . encodeToTextBuilder . toJSON  -- | FIXME What's this exactly?-limitOffsetOrder :: PersistEntity val-  => [SelectOpt val]-  -> (Int, Int, [SelectOpt val])+limitOffsetOrder+    :: (PersistEntity val)+    => [SelectOpt val]+    -> (Int, Int, [SelectOpt val]) limitOffsetOrder opts =     foldr go (0, 0, []) opts   where-    go (LimitTo l) (_, b, c) = (l, b ,c)+    go (LimitTo l) (_, b, c) = (l, b, c)     go (OffsetBy o) (a, _, c) = (a, o, c)     go x (a, b, c) = (a, b, x : c)
Database/Persist/Class.hs view
@@ -9,40 +9,38 @@ -- -- Methods and functions in this module have examples documented under an -- "Example Usage" thing, that you need to click on to expand.--- module Database.Persist.Class-    (+    ( -- * PersistStore -    -- * PersistStore-    -- | The 'PersistStore', 'PersistStoreRead', and 'PersistStoreWrite' type-    -- classes are used to define basic operations on the database. A database-    -- that implements these classes is capable of being used as a simple-    -- key-value store.-    ---    -- All the examples present here will be explained based on these schemas, datasets and functions:-    ---    -- = schema-1-    ---    -- #schema-persist-store-1#-    ---    -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|-    -- > User-    -- >     name String-    -- >     age Int-    -- >     deriving Show-    -- > |]-    ---    -- = dataset-1-    ---    -- #dataset-persist-store-1#-    ---    -- > +----+-------+-----+-    -- > | id | name  | age |-    -- > +----+-------+-----+-    -- > |  1 | SPJ   |  40 |-    -- > +----+-------+-----+-    -- > |  2 | Simon |  41 |-    -- > +----+-------+-----++      -- | The 'PersistStore', 'PersistStoreRead', and 'PersistStoreWrite' type+      -- classes are used to define basic operations on the database. A database+      -- that implements these classes is capable of being used as a simple+      -- key-value store.+      --+      -- All the examples present here will be explained based on these schemas, datasets and functions:+      --+      -- = schema-1+      --+      -- #schema-persist-store-1#+      --+      -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|+      -- > User+      -- >     name String+      -- >     age Int+      -- >     deriving Show+      -- > |]+      --+      -- = dataset-1+      --+      -- #dataset-persist-store-1#+      --+      -- > +----+-------+-----++      -- > | id | name  | age |+      -- > +----+-------+-----++      -- > |  1 | SPJ   |  40 |+      -- > +----+-------+-----++      -- > |  2 | Simon |  41 |+      -- > +----+-------+-----+       PersistStore     , PersistStoreRead (..)     , PersistStoreWrite (..)@@ -56,52 +54,52 @@     , insertEntity     , insertRecord -    -- * PersistUnique-    -- | The 'PersistUnique' type class is relevant for database backends that-    -- offer uniqueness keys. Uniquenes keys allow us to perform operations like-    -- 'getBy', 'deleteBy', as well as 'upsert' and 'putMany'.-    ---    -- All the examples present here will be explained based on these two schemas and the dataset:-    ---    -- = schema-1-    -- This schema has single unique constraint.-    ---    -- #schema-persist-unique-1#-    ---    -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|-    -- > User-    -- >     name String-    -- >     age Int-    -- >     UniqueUserName name-    -- >     deriving Show-    -- > |]-    ---    -- = schema-2-    -- This schema has two unique constraints.-    ---    -- #schema-persist-unique-2#-    ---    -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|-    -- > User-    -- >     name String-    -- >     age Int-    -- >     UniqueUserName name-    -- >     UniqueUserAge age-    -- >     deriving Show-    -- > |]-    ---    -- = dataset-1-    ---    -- #dataset-persist-unique-1#-    ---    -- > +-----+-----+-----+-    -- > |id   |name |age  |-    -- > +-----+-----+-----+-    -- > |1    |SPJ  |40   |-    -- > +-----+-----+-----+-    -- > |2    |Simon|41   |-    -- > +-----+-----+-----++      -- * PersistUnique +      -- | The 'PersistUnique' type class is relevant for database backends that+      -- offer uniqueness keys. Uniquenes keys allow us to perform operations like+      -- 'getBy', 'deleteBy', as well as 'upsert' and 'putMany'.+      --+      -- All the examples present here will be explained based on these two schemas and the dataset:+      --+      -- = schema-1+      -- This schema has single unique constraint.+      --+      -- #schema-persist-unique-1#+      --+      -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|+      -- > User+      -- >     name String+      -- >     age Int+      -- >     UniqueUserName name+      -- >     deriving Show+      -- > |]+      --+      -- = schema-2+      -- This schema has two unique constraints.+      --+      -- #schema-persist-unique-2#+      --+      -- > share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase|+      -- > User+      -- >     name String+      -- >     age Int+      -- >     UniqueUserName name+      -- >     UniqueUserAge age+      -- >     deriving Show+      -- > |]+      --+      -- = dataset-1+      --+      -- #dataset-persist-unique-1#+      --+      -- > +-----+-----+-----++      -- > |id   |name |age  |+      -- > +-----+-----+-----++      -- > |1    |SPJ  |40   |+      -- > +-----+-----+-----++      -- > |2    |Simon|41   |+      -- > +-----+-----+-----+     , PersistUnique     , PersistUniqueRead (..)     , PersistUniqueWrite (..)@@ -118,10 +116,11 @@     , checkUniqueUpdateable     , onlyUnique -    -- * PersistQuery-    -- |  The 'PersistQuery' type class allows us to select lists and filter-    -- database models.  'selectList' is the canonical read operation, and we-    -- can write 'updateWhere' and 'deleteWhere' to modify based on filters.+      -- * PersistQuery++      -- |  The 'PersistQuery' type class allows us to select lists and filter+      -- database models.  'selectList' is the canonical read operation, and we+      -- can write 'updateWhere' and 'deleteWhere' to modify based on filters.     , selectList     , selectKeys     , PersistQuery@@ -130,17 +129,19 @@     , selectSource     , selectKeysList -    -- * PersistEntity+      -- * PersistEntity     , PersistEntity (..)     , tabulateEntity     , SymbolToField (..)-    -- * PersistField++      -- * PersistField     , PersistField (..)-    -- * PersistConfig++      -- * PersistConfig     , PersistConfig (..)     , entityValues -    -- * Lifting+      -- * Lifting     , HasPersistBackend (..)     , withBaseBackend     , IsPersistBackend ()@@ -148,17 +149,22 @@     , BackendCompatible (..)     , withCompatibleBackend -    -- * PersistCore-    -- | 'PersistCore' is a type class that defines a default database-    -- 'BackendKey' type. For SQL databases, this is currently an-    -- auto-incrementing inteer primary key. For MongoDB, it is the default-    -- ObjectID.+      -- * PersistCore++      -- | 'PersistCore' is a type class that defines a default database+      -- 'BackendKey' type. For SQL databases, this is currently an+      -- auto-incrementing inteer primary key. For MongoDB, it is the default+      -- ObjectID.     , PersistCore (..)     , ToBackendKey (..)-    -- * JSON utilities-    , keyValueEntityToJSON, keyValueEntityFromJSON-    , entityIdToJSON, entityIdFromJSON-    , toPersistValueJSON, fromPersistValueJSON++      -- * JSON utilities+    , keyValueEntityToJSON+    , keyValueEntityFromJSON+    , entityIdToJSON+    , entityIdFromJSON+    , toPersistValueJSON+    , fromPersistValueJSON     ) where  import Database.Persist.Class.PersistConfig@@ -167,7 +173,6 @@ import Database.Persist.Class.PersistQuery import Database.Persist.Class.PersistStore import Database.Persist.Class.PersistUnique-  -- | A backwards-compatible alias for those that don't care about distinguishing between read and write queries. -- It signifies the assumption that, by default, a backend can write as well as read.
Database/Persist/Class/PersistConfig.hs view
@@ -36,18 +36,21 @@     createPoolConfig :: c -> IO (PersistConfigPool c)      -- | Run a database action by taking a connection from the pool.-    runPool :: MonadUnliftIO m-            => c-            -> PersistConfigBackend c m a-            -> PersistConfigPool c-            -> m a+    runPool+        :: (MonadUnliftIO m)+        => c+        -> PersistConfigBackend c m a+        -> PersistConfigPool c+        -> m a  instance-  ( PersistConfig c1-  , PersistConfig c2-  , PersistConfigPool c1 ~ PersistConfigPool c2-  , PersistConfigBackend c1 ~ PersistConfigBackend c2-  ) => PersistConfig (Either c1 c2) where+    ( PersistConfig c1+    , PersistConfig c2+    , PersistConfigPool c1 ~ PersistConfigPool c2+    , PersistConfigBackend c1 ~ PersistConfigBackend c2+    )+    => PersistConfig (Either c1 c2)+    where     type PersistConfigBackend (Either c1 c2) = PersistConfigBackend c1     type PersistConfigPool (Either c1 c2) = PersistConfigPool c1 
Database/Persist/Class/PersistEntity.hs view
@@ -1,18 +1,18 @@-{-# LANGUAGE TypeOperators #-} {-# LANGUAGE AllowAmbiguousTypes #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-}-{-# language PatternSynonyms #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-}+{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE CPP #-}  module Database.Persist.Class.PersistEntity     ( PersistEntity (..)@@ -25,40 +25,46 @@     , BackendSpecificFilter     , Entity (.., Entity, entityKey, entityVal)     , ViaPersistEntity (..)-     , recordName     , entityValues-    , keyValueEntityToJSON, keyValueEntityFromJSON-    , entityIdToJSON, entityIdFromJSON+    , keyValueEntityToJSON+    , keyValueEntityFromJSON+    , entityIdToJSON+    , entityIdFromJSON+       -- * PersistField based on other typeclasses-    , toPersistValueJSON, fromPersistValueJSON-    , toPersistValueEnum, fromPersistValueEnum+    , toPersistValueJSON+    , fromPersistValueJSON+    , toPersistValueEnum+    , fromPersistValueEnum+       -- * Support for @OverloadedLabels@ with 'EntityField'     , SymbolToField (..)-    , -- * Safety check for inserts-      SafeToInsert++      -- * Safety check for inserts+    , SafeToInsert     , SafeToInsertErrorMessage     ) where -import Data.Functor.Constant import Data.Functor.Apply (Apply)+import Data.Functor.Constant  import Data.Aeson-       ( FromJSON(..)-       , ToJSON(..)-       , Value(Object)-       , fromJSON-       , object-       , withObject-       , (.:)-       , (.=)-       )+    ( FromJSON (..)+    , ToJSON (..)+    , Value (Object)+    , fromJSON+    , object+    , withObject+    , (.:)+    , (.=)+    ) import qualified Data.Aeson.Parser as AP import Data.Aeson.Text (encodeToTextBuilder)-import Data.Aeson.Types (Parser, Result(Error, Success))+import Data.Aeson.Types (Parser, Result (Error, Success)) import Data.Attoparsec.ByteString (parseOnly) import Data.Functor.Identity-import Web.PathPieces (PathMultiPiece(..), PathPiece(..))+import Web.PathPieces (PathMultiPiece (..), PathPiece (..))  #if MIN_VERSION_aeson(2,0,0) import qualified Data.Aeson.KeyMap as AM@@ -66,8 +72,8 @@ import qualified Data.HashMap.Strict as AM #endif -import GHC.Records-import Data.List.NonEmpty (NonEmpty(..))+import Data.Kind (Type)+import Data.List.NonEmpty (NonEmpty (..)) import Data.Maybe (isJust) import Data.Text (Text) import qualified Data.Text as T@@ -76,8 +82,8 @@ import qualified Data.Text.Lazy.Builder as TB import GHC.Generics import GHC.OverloadedLabels+import GHC.Records import GHC.TypeLits-import Data.Kind (Type)  import Database.Persist.Class.PersistField import Database.Persist.Names@@ -97,19 +103,30 @@ -- Some advanced type system capabilities are used to make this process -- type-safe. Persistent users usually don't need to understand the class -- associated data and functions.-class ( PersistField (Key record), ToJSON (Key record), FromJSON (Key record)-      , Show (Key record), Read (Key record), Eq (Key record), Ord (Key record))-  => PersistEntity record where+class+    ( PersistField (Key record)+    , ToJSON (Key record)+    , FromJSON (Key record)+    , Show (Key record)+    , Read (Key record)+    , Eq (Key record)+    , Ord (Key record)+    ) =>+    PersistEntity record+    where     -- | Persistent allows multiple different backends (databases).     type PersistEntityBackend record      -- | By default, a backend will automatically generate the key     -- Instead you can specify a Primary key made up of unique values.     data Key record+     -- | A lower-level key operation.     keyToValues :: Key record -> [PersistValue]+     -- | A lower-level key operation.     keyFromValues :: [PersistValue] -> Either Text (Key record)+     -- | A meta-operation to retrieve the 'Key' 'EntityField'.     persistIdField :: EntityField record (Key record) @@ -123,10 +140,13 @@     -- language extension to refer to 'EntityField' values polymorphically. See     -- the documentation on 'SymbolToField' for more information.     data EntityField record :: Type -> Type+     -- | Return meta-data for a given 'EntityField'.     persistFieldDef :: EntityField record typ -> FieldDef+     -- | A meta-operation to get the database fields of a record.     toPersistFields :: record -> [PersistValue]+     -- | A lower-level operation to convert from database values to a Haskell record.     fromPersistValues :: [PersistValue] -> Either Text record @@ -155,7 +175,7 @@     --     -- @since 2.14.0.0     tabulateEntityA-        :: Applicative f+        :: (Applicative f)         => (forall a. EntityField record a -> f a)         -- ^ A function that builds a fragment of a record in an         -- 'Applicative' context.@@ -173,16 +193,23 @@      -- | Unique keys besides the 'Key'.     data Unique record+     -- | A meta operation to retrieve all the 'Unique' keys.     persistUniqueKeys :: record -> [Unique record]+     -- | A lower level operation.-    persistUniqueToFieldNames :: Unique record -> NonEmpty (FieldNameHS, FieldNameDB)+    persistUniqueToFieldNames+        :: Unique record -> NonEmpty (FieldNameHS, FieldNameDB)+     -- | A lower level operation.     persistUniqueToValues :: Unique record -> [PersistValue]      -- | Use a 'PersistField' as a lens.-    fieldLens :: EntityField record field-              -> (forall f. Functor f => (field -> f field) -> Entity record -> f (Entity record))+    fieldLens+        :: EntityField record field+        -> ( forall f+              . (Functor f) => (field -> f field) -> Entity record -> f (Entity record)+           )      -- | Extract a @'Key' record@ from a @record@ value. Currently, this is     -- only defined for entities using the @Primary@ syntax for@@ -199,7 +226,7 @@ -- @since 2.14.6.0 newtype ViaPersistEntity record = ViaPersistEntity (Key record) -instance PersistEntity record => PathMultiPiece (ViaPersistEntity record) where+instance (PersistEntity record) => PathMultiPiece (ViaPersistEntity record) where     fromPathMultiPiece pieces = do         Right key <- keyFromValues <$> mapM fromPathPiece pieces         pure $ ViaPersistEntity key@@ -238,7 +265,7 @@ -- -- @since 2.14.0.0 tabulateEntity-    :: PersistEntity record+    :: (PersistEntity record)     => (forall a. EntityField record a -> a)     -> Entity record tabulateEntity fromField =@@ -247,6 +274,7 @@ type family BackendSpecificUpdate backend record  -- Moved over from Database.Persist.Class.PersistUnique+ -- | Textual representation of the record recordName     :: (PersistEntity record)@@ -256,22 +284,24 @@ -- | Updating a database entity. -- -- Persistent users use combinators to create these.-data Update record = forall typ. PersistField typ => Update-    { updateField :: EntityField record typ-    , updateValue :: typ-    -- FIXME Replace with expr down the road-    , updateUpdate :: PersistUpdate-    }+data Update record+    = forall typ. (PersistField typ) => Update+        { updateField :: EntityField record typ+        , updateValue :: typ+        , -- FIXME Replace with expr down the road+          updateUpdate :: PersistUpdate+        }     | BackendUpdate-          (BackendSpecificUpdate (PersistEntityBackend record) record)+        (BackendSpecificUpdate (PersistEntityBackend record) record)  -- | Query options. -- -- Persistent users use these directly.-data SelectOpt record = forall typ. Asc  (EntityField record typ)-                      | forall typ. Desc (EntityField record typ)-                      | OffsetBy Int-                      | LimitTo Int+data SelectOpt record+    = forall typ. Asc (EntityField record typ)+    | forall typ. Desc (EntityField record typ)+    | OffsetBy Int+    | LimitTo Int  type family BackendSpecificFilter backend record @@ -287,23 +317,25 @@ -- 'PersistFilter' requires that you have an array- or list-shaped -- 'EntityField'. It is possible to construct values using this that will -- create malformed runtime values.-data Filter record = forall typ. PersistField typ => Filter-    { filterField  :: EntityField record typ-    , filterValue  :: FilterValue typ-    , filterFilter :: PersistFilter -- FIXME-    }-    | FilterAnd [Filter record] -- ^ convenient for internal use, not needed for the API-    | FilterOr  [Filter record]+data Filter record+    = forall typ. (PersistField typ) => Filter+        { filterField :: EntityField record typ+        , filterValue :: FilterValue typ+        , filterFilter :: PersistFilter -- FIXME+        }+    | -- | convenient for internal use, not needed for the API+      FilterAnd [Filter record]+    | FilterOr [Filter record]     | BackendFilter-          (BackendSpecificFilter (PersistEntityBackend record) record)+        (BackendSpecificFilter (PersistEntityBackend record) record)  -- | Value to filter with. Highly dependant on the type of filter used. -- -- @since 2.10.0 data FilterValue typ where-  FilterValue  :: typ -> FilterValue typ-  FilterValues :: [typ] -> FilterValue typ-  UnsafeValue  :: forall a typ. PersistField a => a -> FilterValue typ+    FilterValue :: typ -> FilterValue typ+    FilterValues :: [typ] -> FilterValue typ+    UnsafeValue :: forall a typ. (PersistField a) => a -> FilterValue typ  -- | Datatype that represents an entity, with both its 'Key' and -- its Haskell record representation.@@ -335,27 +367,28 @@ -- your query returns two entities (i.e. @(Entity backend a, -- Entity backend b)@), then you must you use @SELECT ??, ?? -- WHERE ...@, and so on.-data Entity record =-    Entity-        { entityKey :: Key record-        , entityVal :: record-        }+data Entity record+    = Entity+    { entityKey :: Key record+    , entityVal :: record+    } -deriving instance (Generic (Key record), Generic record) => Generic (Entity record)+deriving instance+    (Generic (Key record), Generic record) => Generic (Entity record) deriving instance (Eq (Key record), Eq record) => Eq (Entity record) deriving instance (Ord (Key record), Ord record) => Ord (Entity record) deriving instance (Show (Key record), Show record) => Show (Entity record) deriving instance (Read (Key record), Read record) => Read (Entity record)  -- | Get list of values corresponding to given entity.-entityValues :: PersistEntity record => Entity record -> [PersistValue]+entityValues :: (PersistEntity record) => Entity record -> [PersistValue] entityValues (Entity k record) =-  if isJust (entityPrimary ent)-    then-      -- TODO: check against the key-      map toPersistValue (toPersistFields record)-    else-      keyToValues k ++ map toPersistValue (toPersistFields record)+    if isJust (entityPrimary ent)+        then+            -- TODO: check against the key+            map toPersistValue (toPersistFields record)+        else+            keyToValues k ++ map toPersistValue (toPersistFields record)   where     ent = entityDef $ Just record @@ -368,12 +401,14 @@ -- instance ToJSON (Entity User) where --     toJSON = keyValueEntityToJSON -- @-keyValueEntityToJSON :: (PersistEntity record, ToJSON record)-                     => Entity record -> Value-keyValueEntityToJSON (Entity key value) = object-    [ "key" .= key-    , "value" .= value-    ]+keyValueEntityToJSON+    :: (PersistEntity record, ToJSON record)+    => Entity record -> Value+keyValueEntityToJSON (Entity key value) =+    object+        [ "key" .= key+        , "value" .= value+        ]  -- | Predefined @parseJSON@. The input JSON looks like -- @{"key": 1, "value": {"name": ...}}@.@@ -384,11 +419,13 @@ -- instance FromJSON (Entity User) where --     parseJSON = keyValueEntityFromJSON -- @-keyValueEntityFromJSON :: (PersistEntity record, FromJSON record)-                       => Value -> Parser (Entity record)-keyValueEntityFromJSON (Object o) = Entity-    <$> o .: "key"-    <*> o .: "value"+keyValueEntityFromJSON+    :: (PersistEntity record, FromJSON record)+    => Value -> Parser (Entity record)+keyValueEntityFromJSON (Object o) =+    Entity+        <$> o .: "key"+        <*> o .: "value" keyValueEntityFromJSON _ = fail "keyValueEntityFromJSON: not an object"  -- | Predefined @toJSON@. The resulting JSON looks like@@ -400,10 +437,11 @@ -- instance ToJSON (Entity User) where --     toJSON = entityIdToJSON -- @-entityIdToJSON :: (PersistEntity record, ToJSON record) => Entity record -> Value+entityIdToJSON+    :: (PersistEntity record, ToJSON record) => Entity record -> Value entityIdToJSON (Entity key value) = case toJSON value of-        Object o -> Object $ AM.insert "id" (toJSON key) o-        x -> x+    Object o -> Object $ AM.insert "id" (toJSON key) o+    x -> x  -- | Predefined @parseJSON@. The input JSON looks like -- @{"id": 1, "name": ...}@.@@ -414,7 +452,8 @@ -- instance FromJSON (Entity User) where --     parseJSON = entityIdFromJSON -- @-entityIdFromJSON :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record)+entityIdFromJSON+    :: (PersistEntity record, FromJSON record) => Value -> Parser (Entity record) entityIdFromJSON = withObject "entityIdFromJSON" $ \o -> do     val <- parseJSON (Object o)     k <- case keyFromRecordM of@@ -424,24 +463,26 @@             pure $ func val     pure $ Entity k val -instance (PersistEntity record, PersistField record, PersistField (Key record))-  => PersistField (Entity record) where+instance+    (PersistEntity record, PersistField record, PersistField (Key record))+    => PersistField (Entity record)+    where     toPersistValue (Entity key value) = case toPersistValue value of         (PersistMap alist) -> PersistMap ((idField, toPersistValue key) : alist)         _ -> error $ T.unpack $ errMsg "expected PersistMap"      fromPersistValue (PersistMap alist) = case after of         [] -> Left $ errMsg $ "did not find " `mappend` idField `mappend` " field"-        ("_id", kv):afterRest ->+        ("_id", kv) : afterRest ->             fromPersistValue (PersistMap (before ++ afterRest)) >>= \record ->                 keyFromValues [kv] >>= \k ->                     Right (Entity k record)         _ -> Left $ errMsg $ "impossible id field: " `mappend` T.pack (show alist)       where         (before, after) = break ((== idField) . fst) alist--    fromPersistValue x = Left $-          errMsg "Expected PersistMap, received: " `mappend` T.pack (show x)+    fromPersistValue x =+        Left $+            errMsg "Expected PersistMap, received: " `mappend` T.pack (show x)  errMsg :: Text -> Text errMsg = mappend "PersistField entity fromPersistValue: "@@ -462,7 +503,7 @@ --   fromPersistValue = fromPersistValueJSON --   toPersistValue = toPersistValueJSON -- @-toPersistValueJSON :: ToJSON a => a -> PersistValue+toPersistValueJSON :: (ToJSON a) => a -> PersistValue toPersistValueJSON = PersistText . LT.toStrict . TB.toLazyText . encodeToTextBuilder . toJSON  -- | Convenience function for getting a free 'PersistField' instance@@ -478,20 +519,23 @@ --   fromPersistValue = fromPersistValueJSON --   toPersistValue = toPersistValueJSON -- @-fromPersistValueJSON :: FromJSON a => PersistValue -> Either Text a+fromPersistValueJSON :: (FromJSON a) => PersistValue -> Either Text a fromPersistValueJSON z = case z of-  PersistByteString bs -> mapLeft (T.append "Could not parse the JSON (was a PersistByteString): ")-                        $ parseGo bs-  PersistText t -> mapLeft (T.append "Could not parse the JSON (was PersistText): ")-                 $ parseGo (TE.encodeUtf8 t)-  a -> Left $ T.append "Expected PersistByteString, received: " (T.pack (show a))-  where parseGo bs = mapLeft T.pack $ case parseOnly AP.value bs of-          Left err -> Left err-          Right v -> case fromJSON v of+    PersistByteString bs ->+        mapLeft (T.append "Could not parse the JSON (was a PersistByteString): ") $+            parseGo bs+    PersistText t ->+        mapLeft (T.append "Could not parse the JSON (was PersistText): ") $+            parseGo (TE.encodeUtf8 t)+    a -> Left $ T.append "Expected PersistByteString, received: " (T.pack (show a))+  where+    parseGo bs = mapLeft T.pack $ case parseOnly AP.value bs of+        Left err -> Left err+        Right v -> case fromJSON v of             Error err -> Left err             Success a -> Right a-        mapLeft _ (Right a) = Right a-        mapLeft f (Left b)  = Left (f b)+    mapLeft _ (Right a) = Right a+    mapLeft f (Left b) = Left (f b)  -- | Convenience function for getting a free 'PersistField' instance -- from a type with an 'Enum' instance. The function 'derivePersistField'@@ -509,7 +553,7 @@ --   fromPersistValue = fromPersistValueEnum --   toPersistValue = toPersistValueEnum -- @-toPersistValueEnum :: Enum a => a -> PersistValue+toPersistValueEnum :: (Enum a) => a -> PersistValue toPersistValueEnum = toPersistValue . fromEnum  -- | Convenience function for getting a free 'PersistField' instance@@ -527,11 +571,20 @@ -- @ fromPersistValueEnum :: (Enum a, Bounded a) => PersistValue -> Either Text a fromPersistValueEnum v = fromPersistValue v >>= go-  where go i = let res = toEnum i in-               if i >= fromEnum (asTypeOf minBound res) && i <= fromEnum (asTypeOf maxBound res)-                 then Right res-                 else Left ("The number " `mappend` T.pack (show i) `mappend` " was out of the "-                  `mappend` "allowed bounds for an enum type")+  where+    go i =+        let+            res = toEnum i+         in+            if i >= fromEnum (asTypeOf minBound res) && i <= fromEnum (asTypeOf maxBound res)+                then Right res+                else+                    Left+                        ( "The number "+                            `mappend` T.pack (show i)+                            `mappend` " was out of the "+                            `mappend` "allowed bounds for an enum type"+                        )  -- | This type class is used with the @OverloadedLabels@ extension to -- provide a more convenient means of using the 'EntityField' type.@@ -561,7 +614,7 @@ -- @OverloadedLabels@ support to the 'EntityField' type. -- -- @since 2.11.0.0-instance SymbolToField sym rec typ => IsLabel sym (EntityField rec typ) where+instance (SymbolToField sym rec typ) => IsLabel sym (EntityField rec typ) where     fromLabel = symbolToField @sym  -- | A type class which is used to witness that a type is safe to insert into@@ -575,25 +628,30 @@ -- 'insertKey'. -- -- @since 2.14.0.0-class SafeToInsert a where+class SafeToInsert a -type SafeToInsertErrorMessage a-    = 'Text "The PersistEntity " ':<>: ShowType a ':<>: 'Text " does not have a default primary key."-    ':$$: 'Text "This means that 'insert' will fail with a database error."-    ':$$: 'Text "Please  provide a default= clause inthe entity definition,"-    ':$$: 'Text "or use 'insertKey' instead to provide one."+type SafeToInsertErrorMessage a =+    'Text "The PersistEntity "+        ':<>: ShowType a+        ':<>: 'Text " does not have a default primary key."+        ':$$: 'Text "This means that 'insert' will fail with a database error."+        ':$$: 'Text "Please  provide a default= clause inthe entity definition,"+        ':$$: 'Text "or use 'insertKey' instead to provide one."  instance (TypeError (FunctionErrorMessage a b)) => SafeToInsert (a -> b)  type FunctionErrorMessage a b =-    'Text "Uh oh! It looks like you are trying to insert a function into the database."-    ':$$: 'Text "Argument: " ':<>: 'ShowType a-    ':$$: 'Text "Result:   " ':<>: 'ShowType b-    ':$$: 'Text "You probably need to add more arguments to an Entity construction."+    'Text+        "Uh oh! It looks like you are trying to insert a function into the database."+        ':$$: 'Text "Argument: " ':<>: 'ShowType a+        ':$$: 'Text "Result:   " ':<>: 'ShowType b+        ':$$: 'Text "You probably need to add more arguments to an Entity construction."  type EntityErrorMessage a =-    'Text "It looks like you're trying to `insert` an `Entity " ':<>: 'ShowType a ':<>: 'Text "` directly."-    ':$$: 'Text "You want `insertKey` instead. As an example:"-    ':$$: 'Text "    insertKey (entityKey ent) (entityVal ent)"+    'Text "It looks like you're trying to `insert` an `Entity "+        ':<>: 'ShowType a+        ':<>: 'Text "` directly."+        ':$$: 'Text "You want `insertKey` instead. As an example:"+        ':$$: 'Text "    insertKey (entityKey ent) (entityVal ent)" -instance TypeError (EntityErrorMessage a) => SafeToInsert (Entity a)+instance (TypeError (EntityErrorMessage a)) => SafeToInsert (Entity a)
Database/Persist/Class/PersistField.hs view
@@ -1,51 +1,53 @@ {-# LANGUAGE CPP #-}-{-# LANGUAGE GADTs #-}+{-# LANGUAGE DataKinds #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE PatternGuards, DataKinds, TypeOperators, UndecidableInstances, GeneralizedNewtypeDeriving #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE PatternGuards #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE UndecidableInstances #-}+ module Database.Persist.Class.PersistField     ( PersistField (..)     , getPersistMap-    , OverflowNatural(..)+    , OverflowNatural (..)     ) where  import Control.Arrow (second) import Control.Monad ((<=<)) import qualified Data.Aeson as A-import Data.ByteString.Char8 (ByteString, unpack, readInt)+import Data.ByteString.Char8 (ByteString, readInt, unpack) import qualified Data.ByteString.Lazy as L import Data.Fixed import Data.Foldable (asum)-import Data.Int (Int8, Int16, Int32, Int64)+import Data.Int (Int16, Int32, Int64, Int8) import qualified Data.IntMap as IM import qualified Data.List.NonEmpty as NonEmpty import qualified Data.Map as M+import Data.Ratio (denominator, numerator) import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T-import Data.Text.Read (double) import qualified Data.Text.Encoding as TE import qualified Data.Text.Encoding.Error as TERR import qualified Data.Text.Lazy as TL+import Data.Text.Read (double) import qualified Data.Vector as V-import Data.Word (Word, Word8, Word16, Word32, Word64)+import Data.Word (Word, Word16, Word32, Word64, Word8)+import GHC.TypeLits import Numeric.Natural (Natural) import Text.Blaze.Html import Text.Blaze.Html.Renderer.Text (renderHtml)-import GHC.TypeLits-import Data.Ratio (numerator, denominator)  import Database.Persist.Types.Base -import Data.Time (Day(..), TimeOfDay, UTCTime,-    parseTimeM)-import Data.Time (defaultTimeLocale)+import Data.Time (Day (..), TimeOfDay, UTCTime, defaultTimeLocale, parseTimeM)  #ifdef HIGH_PRECISION_DATE import Data.Time.Clock.POSIX (posixSecondsToUTCTime) #endif - -- | This class teaches Persistent how to take a custom type and marshal it to and from a 'PersistValue', allowing it to be stored in a database. -- -- ==== __Examples__@@ -154,7 +156,8 @@     toPersistValue = PersistInt64     fromPersistValue = fromPersistValueIntegral "Int64" "integer" -fromPersistValueIntegral :: Integral a => Text -> Text -> PersistValue -> Either Text a+fromPersistValueIntegral+    :: (Integral a) => Text -> Text -> PersistValue -> Either Text a fromPersistValueIntegral haskellType sqlType pv = case pv of     PersistInt64 i ->         Right (fromIntegral i)@@ -167,45 +170,57 @@             _denom ->                 boom     PersistByteString bs ->-        case readInt bs of  -- oracle-           Just (i,"") ->-               Right $ fromIntegral i-           Just (i,extra) ->-               Left $ extraInputError haskellType bs i extra-           Nothing ->-               Left $ intParseError haskellType bs+        case readInt bs of -- oracle+            Just (i, "") ->+                Right $ fromIntegral i+            Just (i, extra) ->+                Left $ extraInputError haskellType bs i extra+            Nothing ->+                Left $ intParseError haskellType bs     _ ->         boom   where     boom =         Left $ fromPersistValueError haskellType sqlType pv -extraInputError :: (Show result)-                => Text -- ^ Haskell type-                -> ByteString -- ^ Original bytestring-                -> result -- ^ Integer result-                -> ByteString -- ^  Extra bytestring-                -> Text -- ^ Error message-extraInputError haskellType original result extra = T.concat-    [ "Parsed "-    , TE.decodeUtf8 original-    , " into Haskell type `"-    , haskellType-    , "` with value"-    , T.pack $ show result-    , "but had extra input: "-    , TE.decodeUtf8 extra-    ]+extraInputError+    :: (Show result)+    => Text+    -- ^ Haskell type+    -> ByteString+    -- ^ Original bytestring+    -> result+    -- ^ Integer result+    -> ByteString+    -- ^  Extra bytestring+    -> Text+    -- ^ Error message+extraInputError haskellType original result extra =+    T.concat+        [ "Parsed "+        , TE.decodeUtf8 original+        , " into Haskell type `"+        , haskellType+        , "` with value"+        , T.pack $ show result+        , "but had extra input: "+        , TE.decodeUtf8 extra+        ] -intParseError :: Text -- ^ Haskell type-              -> ByteString -- ^ Original bytestring-              -> Text -- ^ Error message-intParseError haskellType original = T.concat-    [ "Failed to parse Haskell type `"-    , haskellType-    , " from "-    , TE.decodeUtf8 original-    ]+intParseError+    :: Text+    -- ^ Haskell type+    -> ByteString+    -- ^ Original bytestring+    -> Text+    -- ^ Error message+intParseError haskellType original =+    T.concat+        [ "Failed to parse Haskell type `"+        , haskellType+        , " from "+        , TE.decodeUtf8 original+        ]  instance PersistField Data.Word.Word where     toPersistValue = PersistInt64 . fromIntegral@@ -243,8 +258,8 @@     toPersistValue = PersistRational . toRational     fromPersistValue (PersistRational r) = Right $ fromRational r     fromPersistValue (PersistText t) = case reads $ T.unpack t of --  NOTE: Sqlite can store rationals just as string-      [(a, "")] -> Right a-      _ -> Left $ "Can not read " <> t <> " as Fixed"+        [(a, "")] -> Right a+        _ -> Left $ "Can not read " <> t <> " as Fixed"     fromPersistValue (PersistDouble d) = Right $ realToFrac d     fromPersistValue (PersistInt64 i) = Right $ fromIntegral i     fromPersistValue x = Left $ fromPersistValueError "Fixed" "rational, string, double, or integer" x@@ -254,24 +269,48 @@     fromPersistValue (PersistRational r) = Right r     fromPersistValue (PersistDouble d) = Right $ toRational d     fromPersistValue (PersistText t) = case reads $ T.unpack t of --  NOTE: Sqlite can store rationals just as string-      [(a, "")] -> Right $ toRational (a :: Pico)-      _ -> Left $ "Can not read " <> t <> " as Rational (Pico in fact)"+        [(a, "")] -> Right $ toRational (a :: Pico)+        _ -> Left $ "Can not read " <> t <> " as Rational (Pico in fact)"     fromPersistValue (PersistInt64 i) = Right $ fromIntegral i     fromPersistValue (PersistByteString bs) = case double $ T.cons '0' $ TE.decodeUtf8With TERR.lenientDecode bs of-                                                Right (ret,"") -> Right $ toRational ret-                                                Right (a,b) -> Left $ "Invalid bytestring[" <> T.pack (show bs) <> "]: expected a double but returned " <> T.pack (show (a,b))-                                                Left xs -> Left $ "Invalid bytestring[" <> T.pack (show bs) <> "]: expected a double but returned " <> T.pack (show xs)-    fromPersistValue x = Left $ fromPersistValueError "Rational" "rational, double, string, integer, or bytestring" x+        Right (ret, "") -> Right $ toRational ret+        Right (a, b) ->+            Left $+                "Invalid bytestring["+                    <> T.pack (show bs)+                    <> "]: expected a double but returned "+                    <> T.pack (show (a, b))+        Left xs ->+            Left $+                "Invalid bytestring["+                    <> T.pack (show bs)+                    <> "]: expected a double but returned "+                    <> T.pack (show xs)+    fromPersistValue x =+        Left $+            fromPersistValueError+                "Rational"+                "rational, double, string, integer, or bytestring"+                x  instance PersistField Bool where     toPersistValue = PersistBool     fromPersistValue (PersistBool b) = Right b     fromPersistValue (PersistInt64 i) = Right $ i /= 0     fromPersistValue (PersistByteString i) = case readInt i of-                                               Just (0,"") -> Right False-                                               Just (1,"") -> Right True-                                               xs -> Left $ T.pack $ "Failed to parse Haskell type `Bool` from PersistByteString. Original value:" ++ show i ++ ". Parsed by `readInt` as " ++ (show xs) ++ ". Expected '1'."-    fromPersistValue x = Left $ fromPersistValueError "Bool" "boolean, integer, or bytestring of '1' or '0'" x+        Just (0, "") -> Right False+        Just (1, "") -> Right True+        xs ->+            Left $+                T.pack $+                    "Failed to parse Haskell type `Bool` from PersistByteString. Original value:"+                        ++ show i+                        ++ ". Parsed by `readInt` as "+                        ++ (show xs)+                        ++ ". Expected '1'."+    fromPersistValue x =+        Left $+            fromPersistValueError "Bool" "boolean, integer, or bytestring of '1' or '0'" x  instance PersistField Day where     toPersistValue = PersistDay@@ -279,11 +318,11 @@     fromPersistValue (PersistInt64 i) = Right $ ModifiedJulianDay $ toInteger i     fromPersistValue x@(PersistText t) =         case reads $ T.unpack t of-            (d, _):_ -> Right d+            (d, _) : _ -> Right d             _ -> Left $ fromPersistValueParseError "Day" x     fromPersistValue x@(PersistByteString s) =         case reads $ unpack s of-            (d, _):_ -> Right d+            (d, _) : _ -> Right d             _ -> Left $ fromPersistValueParseError "Day" x     fromPersistValue x = Left $ fromPersistValueError "Day" "day, integer, string or bytestring" x @@ -292,11 +331,11 @@     fromPersistValue (PersistTimeOfDay d) = Right d     fromPersistValue x@(PersistText t) =         case reads $ T.unpack t of-            (d, _):_ -> Right d+            (d, _) : _ -> Right d             _ -> Left $ fromPersistValueParseError "TimeOfDay" x     fromPersistValue x@(PersistByteString s) =         case reads $ unpack s of-            (d, _):_ -> Right d+            (d, _) : _ -> Right d             _ -> Left $ fromPersistValueParseError "TimeOfDay" x     fromPersistValue x = Left $ fromPersistValueError "TimeOfDay" "time, string, or bytestring" x @@ -326,13 +365,15 @@ #endif  utcTimeFromPersistText :: Text -> Either Text UTCTime-utcTimeFromPersistText  t =-        let x = PersistText t-            s = T.unpack t-        in-          case NonEmpty.nonEmpty (reads s) of+utcTimeFromPersistText t =+    let+        x = PersistText t+        s = T.unpack t+     in+        case NonEmpty.nonEmpty (reads s) of             Nothing ->-                case asum [parse8601 s, parse8601NoTimezone s, parsePretty s, parsePrettyNoTimezone s] of+                case asum+                    [parse8601 s, parse8601NoTimezone s, parsePretty s, parsePrettyNoTimezone s] of                     Nothing -> Left $ fromPersistValueParseError "UTCTime" x                     Just x' -> Right x'             Just matches ->@@ -342,13 +383,13 @@                 -- here contains the parsed UTCTime with as much microsecond                 -- precision parsed as posssible.                 Right $ fst $ NonEmpty.last matches-      where-        parse8601 = parseTime' "%FT%T%QZ"-        parsePretty = parseTime' "%F %T%QZ"-        -- Before 2.13.3.1 persistent-sqlite was missing the timezone "Z" for UTC,-        -- which was only implicit, so these functions ensure backwards-compatibility.-        parse8601NoTimezone = parseTime' "%FT%T%Q"-        parsePrettyNoTimezone = parseTime' "%F %T%Q"+  where+    parse8601 = parseTime' "%FT%T%QZ"+    parsePretty = parseTime' "%F %T%QZ"+    -- Before 2.13.3.1 persistent-sqlite was missing the timezone "Z" for UTC,+    -- which was only implicit, so these functions ensure backwards-compatibility.+    parse8601NoTimezone = parseTime' "%FT%T%Q"+    parsePrettyNoTimezone = parseTime' "%F %T%Q"  #if MIN_VERSION_time(1,5,0) parseTime' :: String -> String -> Maybe UTCTime@@ -372,37 +413,37 @@ -- non-negative, and are quite efficient for the database to store. -- -- @since 2.11.0-newtype OverflowNatural = OverflowNatural { unOverflowNatural :: Natural }+newtype OverflowNatural = OverflowNatural {unOverflowNatural :: Natural}     deriving (Eq, Show, Ord, Num)  instance-  TypeError-    ( 'Text "The instance of PersistField for the Natural type was removed."-    ':$$: 'Text "Please see the documentation for OverflowNatural if you want to "-    ':$$: 'Text "continue using the old behavior or want to see documentation on "-    ':$$: 'Text "why the instance was removed."-    ':$$: 'Text ""-    ':$$: 'Text "This error instance will be removed in a future release."+    ( TypeError+        ( 'Text "The instance of PersistField for the Natural type was removed."+            ':$$: 'Text "Please see the documentation for OverflowNatural if you want to "+            ':$$: 'Text "continue using the old behavior or want to see documentation on "+            ':$$: 'Text "why the instance was removed."+            ':$$: 'Text ""+            ':$$: 'Text "This error instance will be removed in a future release."+        )     )-  =>-    PersistField Natural-  where+    => PersistField Natural+    where     toPersistValue = undefined     fromPersistValue = undefined  instance PersistField OverflowNatural where-  toPersistValue = (toPersistValue :: Int64 -> PersistValue) . fromIntegral . unOverflowNatural-  fromPersistValue x = case (fromPersistValue x :: Either Text Int64) of-    Left err -> Left $ T.replace "Int64" "OverflowNatural" err-    Right int -> Right $ OverflowNatural $ fromIntegral int -- TODO use bimap?+    toPersistValue = (toPersistValue :: Int64 -> PersistValue) . fromIntegral . unOverflowNatural+    fromPersistValue x = case (fromPersistValue x :: Either Text Int64) of+        Left err -> Left $ T.replace "Int64" "OverflowNatural" err+        Right int -> Right $ OverflowNatural $ fromIntegral int -- TODO use bimap? -instance PersistField a => PersistField (Maybe a) where+instance (PersistField a) => PersistField (Maybe a) where     toPersistValue Nothing = PersistNull     toPersistValue (Just a) = toPersistValue a     fromPersistValue PersistNull = Right Nothing     fromPersistValue x = Just <$> fromPersistValue x -instance {-# OVERLAPPABLE #-} PersistField a => PersistField [a] where+instance {-# OVERLAPPABLE #-} (PersistField a) => PersistField [a] where     toPersistValue = PersistList . fmap toPersistValue     fromPersistValue (PersistList l) = fromPersistList l     fromPersistValue (PersistText t) = fromPersistValue (PersistByteString $ TE.encodeUtf8 t)@@ -413,15 +454,18 @@     fromPersistValue (PersistNull) = Right []     fromPersistValue x = Left $ fromPersistValueError "List" "list, string, bytestring or null" x -instance PersistField a => PersistField (V.Vector a) where-  toPersistValue = toPersistValue . V.toList-  fromPersistValue = either (\e -> Left ("Failed to parse Haskell type `Vector`: " `T.append` e))-                            (Right . V.fromList) . fromPersistValue+instance (PersistField a) => PersistField (V.Vector a) where+    toPersistValue = toPersistValue . V.toList+    fromPersistValue =+        either+            (\e -> Left ("Failed to parse Haskell type `Vector`: " `T.append` e))+            (Right . V.fromList)+            . fromPersistValue  instance (Ord a, PersistField a) => PersistField (S.Set a) where     toPersistValue = PersistList . fmap toPersistValue . S.toList     fromPersistValue (PersistList list) =-      S.fromList <$> fromPersistList list+        S.fromList <$> fromPersistList list     fromPersistValue (PersistText t) = fromPersistValue (PersistByteString $ TE.encodeUtf8 t)     fromPersistValue (PersistByteString bs)         | Just values <- A.decode' (L.fromChunks [bs]) =@@ -429,19 +473,20 @@     fromPersistValue PersistNull = Right S.empty     fromPersistValue x = Left $ fromPersistValueError "Set" "list, string, bytestring or null" x -instance (PersistField a, PersistField b) => PersistField (a,b) where-    toPersistValue (x,y) = PersistList [toPersistValue x, toPersistValue y]+instance (PersistField a, PersistField b) => PersistField (a, b) where+    toPersistValue (x, y) = PersistList [toPersistValue x, toPersistValue y]     fromPersistValue v =         case fromPersistValue v of-            Right [x,y]  -> (,) <$> fromPersistValue x <*> fromPersistValue y-            Left e       -> Left e-            _            -> Left $ T.pack $ "Expected 2 item PersistList, received: " ++ show v+            Right [x, y] -> (,) <$> fromPersistValue x <*> fromPersistValue y+            Left e -> Left e+            _ ->+                Left $ T.pack $ "Expected 2 item PersistList, received: " ++ show v -instance PersistField v => PersistField (IM.IntMap v) where+instance (PersistField v) => PersistField (IM.IntMap v) where     toPersistValue = toPersistValue . IM.toList     fromPersistValue = fmap IM.fromList . fromPersistValue -instance PersistField v => PersistField (M.Map T.Text v) where+instance (PersistField v) => PersistField (M.Map T.Text v) where     toPersistValue = PersistMap . fmap (second toPersistValue) . M.toList     fromPersistValue = fromPersistMap <=< getPersistMap @@ -449,68 +494,94 @@     toPersistValue = id     fromPersistValue = Right -fromPersistList :: PersistField a => [PersistValue] -> Either T.Text [a]+fromPersistList :: (PersistField a) => [PersistValue] -> Either T.Text [a] fromPersistList = mapM fromPersistValue -fromPersistMap :: PersistField v-               => [(T.Text, PersistValue)]-               -> Either T.Text (M.Map T.Text v)-fromPersistMap = foldShortLeft fromPersistValue [] where+fromPersistMap+    :: (PersistField v)+    => [(T.Text, PersistValue)]+    -> Either T.Text (M.Map T.Text v)+fromPersistMap = foldShortLeft fromPersistValue []+  where     -- a fold that short-circuits on Left.     foldShortLeft f = go       where         go acc [] = Right $ M.fromList acc-        go acc ((k, v):kvs) =-          case f v of-            Left e   -> Left e-            Right v' -> go ((k,v'):acc) kvs+        go acc ((k, v) : kvs) =+            case f v of+                Left e -> Left e+                Right v' -> go ((k, v') : acc) kvs  -- | FIXME Add documentation to that. getPersistMap :: PersistValue -> Either T.Text [(T.Text, PersistValue)] getPersistMap (PersistMap kvs) = Right kvs-getPersistMap (PersistText t)  = getPersistMap (PersistByteString $ TE.encodeUtf8 t)+getPersistMap (PersistText t) = getPersistMap (PersistByteString $ TE.encodeUtf8 t) getPersistMap (PersistByteString bs)     | Just pairs <- A.decode' (L.fromChunks [bs]) = Right pairs getPersistMap PersistNull = Right []-getPersistMap x = Left $ fromPersistValueError "[(Text, PersistValue)]" "map, string, bytestring or null" x+getPersistMap x =+    Left $+        fromPersistValueError+            "[(Text, PersistValue)]"+            "map, string, bytestring or null"+            x  instance PersistField Checkmark where-    toPersistValue Active   = PersistBool True+    toPersistValue Active = PersistBool True     toPersistValue Inactive = PersistNull-    fromPersistValue PersistNull         = Right Inactive-    fromPersistValue (PersistBool True)  = Right Active-    fromPersistValue (PersistInt64 1)    = Right Active+    fromPersistValue PersistNull = Right Inactive+    fromPersistValue (PersistBool True) = Right Active+    fromPersistValue (PersistInt64 1) = Right Active     fromPersistValue (PersistByteString i) = case readInt i of-                                               Just (0,"") -> Left "Failed to parse Haskell type `Checkmark`: found `0`, expected `1` or NULL"-                                               Just (1,"") -> Right Active-                                               xs -> Left $ T.pack $ "Failed to parse Haskell type `Checkmark` from PersistByteString. Original value:" ++ show i ++ ". Parsed by `readInt` as " ++ (show xs) ++ ". Expected '1'."+        Just (0, "") ->+            Left "Failed to parse Haskell type `Checkmark`: found `0`, expected `1` or NULL"+        Just (1, "") -> Right Active+        xs ->+            Left $+                T.pack $+                    "Failed to parse Haskell type `Checkmark` from PersistByteString. Original value:"+                        ++ show i+                        ++ ". Parsed by `readInt` as "+                        ++ (show xs)+                        ++ ". Expected '1'."     fromPersistValue (PersistBool False) =-      Left $ T.pack "PersistField Checkmark: found unexpected FALSE value"+        Left $ T.pack "PersistField Checkmark: found unexpected FALSE value"     fromPersistValue other =-      Left $ fromPersistValueError "Checkmark" "boolean, integer, bytestring or null" other-+        Left $+            fromPersistValueError "Checkmark" "boolean, integer, bytestring or null" other -fromPersistValueError :: Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"-                      -> Text -- ^ Database type(s), should appear different from Haskell name, e.g. "integer" or "INT", not "Int".-                      -> PersistValue -- ^ Incorrect value-                      -> Text -- ^ Error message-fromPersistValueError haskellType databaseType received = T.concat-    [ "Failed to parse Haskell type `"-    , haskellType-    , "`; expected "-    , databaseType-    , " from database, but received: "-    , T.pack (show received)-    , ". Potential solution: Check that your database schema matches your Persistent model definitions."-    ]+fromPersistValueError+    :: Text+    -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"+    -> Text+    -- ^ Database type(s), should appear different from Haskell name, e.g. "integer" or "INT", not "Int".+    -> PersistValue+    -- ^ Incorrect value+    -> Text+    -- ^ Error message+fromPersistValueError haskellType databaseType received =+    T.concat+        [ "Failed to parse Haskell type `"+        , haskellType+        , "`; expected "+        , databaseType+        , " from database, but received: "+        , T.pack (show received)+        , ". Potential solution: Check that your database schema matches your Persistent model definitions."+        ] -fromPersistValueParseError :: (Show a)-                           => Text -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"-                           -> a -- ^ Received value-                           -> Text -- ^ Error message-fromPersistValueParseError haskellType received = T.concat-    [ "Failed to parse Haskell type `"-    , haskellType-    , "`, but received "-    , T.pack (show received)-    ]+fromPersistValueParseError+    :: (Show a)+    => Text+    -- ^ Haskell type, should match Haskell name exactly, e.g. "Int64"+    -> a+    -- ^ Received value+    -> Text+    -- ^ Error message+fromPersistValueParseError haskellType received =+    T.concat+        [ "Failed to parse Haskell type `"+        , haskellType+        , "`, but received "+        , T.pack (show received)+        ]
Database/Persist/Class/PersistQuery.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE ExplicitForAll #-}+ module Database.Persist.Class.PersistQuery     ( selectList     , PersistQueryRead (..)@@ -9,14 +10,14 @@     ) where  import Control.Monad.IO.Class (MonadIO, liftIO)-import Control.Monad.Reader   (ReaderT, MonadReader)+import Control.Monad.Reader (MonadReader, ReaderT) import Control.Monad.Trans.Resource (MonadResource, release) import Data.Acquire (Acquire, allocateAcquire, with)-import Data.Conduit (ConduitM, (.|), await, runConduit)+import Data.Conduit (ConduitM, await, runConduit, (.|)) import qualified Data.Conduit.List as CL -import Database.Persist.Class.PersistStore import Database.Persist.Class.PersistEntity+import Database.Persist.Class.PersistStore  -- | Backends supporting conditional read operations. class (PersistCore backend, PersistStoreRead backend) => PersistQueryRead backend where@@ -29,16 +30,17 @@     -- @persistent-pagination@ which efficiently chunks a query into ranges, or     -- investigate a backend-specific streaming solution.     selectSourceRes-           :: (PersistRecordBackend record backend, MonadIO m1, MonadIO m2)-           => [Filter record]-           -> [SelectOpt record]-           -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ()))+        :: (PersistRecordBackend record backend, MonadIO m1, MonadIO m2)+        => [Filter record]+        -> [SelectOpt record]+        -> ReaderT backend m1 (Acquire (ConduitM () (Entity record) m2 ()))      -- | Get just the first record for the criterion.-    selectFirst :: (MonadIO m, PersistRecordBackend record backend)-                => [Filter record]-                -> [SelectOpt record]-                -> ReaderT backend m (Maybe (Entity record))+    selectFirst+        :: (MonadIO m, PersistRecordBackend record backend)+        => [Filter record]+        -> [SelectOpt record]+        -> ReaderT backend m (Maybe (Entity record))     selectFirst filts opts = do         srcRes <- selectSourceRes filts (LimitTo 1 : opts)         liftIO $ with srcRes (\src -> runConduit $ src .| await)@@ -51,24 +53,31 @@         -> ReaderT backend m1 (Acquire (ConduitM () (Key record) m2 ()))      -- | The total number of records fulfilling the given criterion.-    count :: (MonadIO m, PersistRecordBackend record backend)-          => [Filter record] -> ReaderT backend m Int+    count+        :: (MonadIO m, PersistRecordBackend record backend)+        => [Filter record] -> ReaderT backend m Int      -- | Check if there is at least one record fulfilling the given criterion.     --     -- @since 2.11-    exists :: (MonadIO m, PersistRecordBackend record backend)-           => [Filter record] -> ReaderT backend m Bool+    exists+        :: (MonadIO m, PersistRecordBackend record backend)+        => [Filter record] -> ReaderT backend m Bool  -- | Backends supporting conditional write operations-class (PersistQueryRead backend, PersistStoreWrite backend) => PersistQueryWrite backend where+class+    (PersistQueryRead backend, PersistStoreWrite backend) =>+    PersistQueryWrite backend+    where     -- | Update individual fields on any record matching the given criterion.-    updateWhere :: (MonadIO m, PersistRecordBackend record backend)-                => [Filter record] -> [Update record] -> ReaderT backend m ()+    updateWhere+        :: (MonadIO m, PersistRecordBackend record backend)+        => [Filter record] -> [Update record] -> ReaderT backend m ()      -- | Delete all records matching the given criterion.-    deleteWhere :: (MonadIO m, PersistRecordBackend record backend)-                => [Filter record] -> ReaderT backend m ()+    deleteWhere+        :: (MonadIO m, PersistRecordBackend record backend)+        => [Filter record] -> ReaderT backend m ()  -- | Get all records matching the given criterion in the specified order. -- Returns also the identifiers.@@ -78,10 +87,15 @@ -- streaming, see @persistent-pagination@ for a means of chunking results based -- on indexed ranges. selectSource-       :: forall record backend m. (PersistQueryRead backend, MonadResource m, PersistRecordBackend record backend, MonadReader backend m)-       => [Filter record]-       -> [SelectOpt record]-       -> ConduitM () (Entity record) m ()+    :: forall record backend m+     . ( PersistQueryRead backend+       , MonadResource m+       , PersistRecordBackend record backend+       , MonadReader backend m+       )+    => [Filter record]+    -> [SelectOpt record]+    -> ConduitM () (Entity record) m () selectSource filts opts = do     srcRes <- liftPersist $ selectSourceRes filts opts     (releaseKey, src) <- allocateAcquire srcRes@@ -91,10 +105,16 @@ -- | Get the 'Key's of all records matching the given criterion. -- -- For an example, see 'selectList'.-selectKeys :: forall record backend m. (PersistQueryRead backend, MonadResource m, PersistRecordBackend record backend, MonadReader backend m)-           => [Filter record]-           -> [SelectOpt record]-           -> ConduitM () (Key record) m ()+selectKeys+    :: forall record backend m+     . ( PersistQueryRead backend+       , MonadResource m+       , PersistRecordBackend record backend+       , MonadReader backend m+       )+    => [Filter record]+    -> [SelectOpt record]+    -> ConduitM () (Key record) m () selectKeys filts opts = do     srcRes <- liftPersist $ selectKeysRes filts opts     (releaseKey, src) <- allocateAcquire srcRes@@ -172,7 +192,8 @@ --     selectList [] ['Asc' UserCreatedAt, 'LimitTo' 10] -- @ selectList-    :: forall record backend m. (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend)+    :: forall record backend m+     . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend)     => [Filter record]     -> [SelectOpt record]     -> ReaderT backend m [Entity record]@@ -181,10 +202,12 @@     liftIO $ with srcRes (\src -> runConduit $ src .| CL.consume)  -- | Call 'selectKeys' but return the result as a list.-selectKeysList :: forall record backend m. (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend)-               => [Filter record]-               -> [SelectOpt record]-               -> ReaderT backend m [Key record]+selectKeysList+    :: forall record backend m+     . (MonadIO m, PersistQueryRead backend, PersistRecordBackend record backend)+    => [Filter record]+    -> [SelectOpt record]+    -> ReaderT backend m [Key record] selectKeysList filts opts = do     srcRes <- selectKeysRes filts opts     liftIO $ with srcRes (\src -> runConduit $ src .| CL.consume)
Database/Persist/Class/PersistStore.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE TypeOperators #-}+ module Database.Persist.Class.PersistStore     ( HasPersistBackend (..)     , withBaseBackend@@ -17,8 +18,8 @@     , belongsToJust     , insertEntity     , insertRecord-    , ToBackendKey(..)-    , BackendCompatible(..)+    , ToBackendKey (..)+    , BackendCompatible (..)     , withCompatibleBackend     ) where @@ -53,8 +54,9 @@ -- This is a helper for reusing existing queries when expanding the backend type. -- -- @since 2.12.0-withBaseBackend :: (HasPersistBackend backend)-                => ReaderT (BaseBackend backend) m a -> ReaderT backend m a+withBaseBackend+    :: (HasPersistBackend backend)+    => ReaderT (BaseBackend backend) m a -> ReaderT backend m a withBaseBackend = withReaderT persistBackend  -- | Class which witnesses that @backend@ is essentially the same as @BaseBackend backend@.@@ -119,12 +121,14 @@ -- that your backend is compatible with. -- -- @since 2.12.0-withCompatibleBackend :: (BackendCompatible sup sub)-                      => ReaderT sup m a -> ReaderT sub m a+withCompatibleBackend+    :: (BackendCompatible sup sub)+    => ReaderT sup m a -> ReaderT sub m a withCompatibleBackend = withReaderT projectBackend  -- | A convenient alias for common type signatures-type PersistRecordBackend record backend = (PersistEntity record, PersistEntityBackend record ~ BaseBackend backend)+type PersistRecordBackend record backend =+    (PersistEntity record, PersistEntityBackend record ~ BaseBackend backend)  liftPersist     :: (MonadIO m, MonadReader backend m)@@ -142,22 +146,31 @@ -- -- A 'Key' that instead uses a custom type will not be an instance of -- 'ToBackendKey'.-class ( PersistEntity record-      , PersistEntityBackend record ~ backend-      , PersistCore backend-      ) => ToBackendKey backend record where-    toBackendKey   :: Key record -> BackendKey backend+class+    ( PersistEntity record+    , PersistEntityBackend record ~ backend+    , PersistCore backend+    ) =>+    ToBackendKey backend record+    where+    toBackendKey :: Key record -> BackendKey backend     fromBackendKey :: BackendKey backend -> Key record  class PersistCore backend where     data BackendKey backend  class-  ( Show (BackendKey backend), Read (BackendKey backend)-  , Eq (BackendKey backend), Ord (BackendKey backend)-  , PersistCore backend-  , PersistField (BackendKey backend), A.ToJSON (BackendKey backend), A.FromJSON (BackendKey backend)-  ) => PersistStoreRead backend where+    ( Show (BackendKey backend)+    , Read (BackendKey backend)+    , Eq (BackendKey backend)+    , Ord (BackendKey backend)+    , PersistCore backend+    , PersistField (BackendKey backend)+    , A.ToJSON (BackendKey backend)+    , A.FromJSON (BackendKey backend)+    ) =>+    PersistStoreRead backend+    where     -- | Get a record by identifier, if available.     --     -- === __Example usage__@@ -176,7 +189,9 @@     -- > +------+-----+     -- > | SPJ  |  40 |     -- > +------+-----+-    get :: forall record m. (MonadIO m, PersistRecordBackend record backend)+    get+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => Key record -> ReaderT backend m (Maybe record)      -- | Get many records by their respective identifiers, if available.@@ -202,22 +217,30 @@     -- > |  2 | Simon |  41 |     -- > +----+-------+-----+     getMany-        :: forall record m. (MonadIO m, PersistRecordBackend record backend)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => [Key record] -> ReaderT backend m (Map (Key record) record)     getMany [] = return Map.empty     getMany ks = do         vs <- mapM get ks-        let kvs   = zip ks vs-        let kvs'  = (fmap Maybe.fromJust) `fmap` filter (\(_,v) -> Maybe.isJust v) kvs+        let+            kvs = zip ks vs+        let+            kvs' = (fmap Maybe.fromJust) `fmap` filter (\(_, v) -> Maybe.isJust v) kvs         return $ Map.fromList kvs'  class-  ( Show (BackendKey backend), Read (BackendKey backend)-  , Eq (BackendKey backend), Ord (BackendKey backend)-  , PersistStoreRead backend-  , PersistField (BackendKey backend), A.ToJSON (BackendKey backend), A.FromJSON (BackendKey backend)-  ) => PersistStoreWrite backend where-+    ( Show (BackendKey backend)+    , Read (BackendKey backend)+    , Eq (BackendKey backend)+    , Ord (BackendKey backend)+    , PersistStoreRead backend+    , PersistField (BackendKey backend)+    , A.ToJSON (BackendKey backend)+    , A.FromJSON (BackendKey backend)+    ) =>+    PersistStoreWrite backend+    where     -- | Create a new record in the database, returning an automatically created     -- key (in SQL an auto-increment id).     --@@ -241,8 +264,10 @@     -- > +-----+------+-----+     -- > |3    |John  |30   |     -- > +-----+------+-----+-    insert :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)-           => record -> ReaderT backend m (Key record)+    insert+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        => record -> ReaderT backend m (Key record)      -- | Same as 'insert', but doesn't return a @Key@.     --@@ -264,8 +289,10 @@     -- > +-----+------+-----+     -- > |3    |John  |30   |     -- > +-----+------+-----+-    insert_ :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)-            => record -> ReaderT backend m ()+    insert_+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        => record -> ReaderT backend m ()     insert_ record = insert record >> return ()      -- | Create multiple records in the database and return their 'Key's.@@ -302,8 +329,10 @@     -- > +-----+------+-----+     -- > |5    |Jane  |20   |     -- > +-----+------+-----+-    insertMany :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)-               => [record] -> ReaderT backend m [Key record]+    insertMany+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        => [record] -> ReaderT backend m [Key record]     insertMany = mapM insert      -- | Same as 'insertMany', but doesn't return any 'Key's.@@ -333,8 +362,10 @@     -- > +-----+------+-----+     -- > |5    |Jane  |20   |     -- > +-----+------+-----+-    insertMany_ :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)-                => [record] -> ReaderT backend m ()+    insertMany_+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        => [record] -> ReaderT backend m ()     insertMany_ x = insertMany x >> return ()      -- | Same as 'insertMany_', but takes an 'Entity' instead of just a record.@@ -365,8 +396,10 @@     -- > +-----+------+-----+     -- > |4    |Eva   |38   |     -- > +-----+------+-----+-    insertEntityMany :: forall record m. (MonadIO m, PersistRecordBackend record backend)-                     => [Entity record] -> ReaderT backend m ()+    insertEntityMany+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => [Entity record] -> ReaderT backend m ()     insertEntityMany = mapM_ (\(Entity k record) -> insertKey k record)      -- | Create a new record in the database using the given key.@@ -390,8 +423,10 @@     -- > +-----+------+-----+     -- > |3    |Alice |20   |     -- > +-----+------+-----+-    insertKey :: forall record m. (MonadIO m, PersistRecordBackend record backend)-              => Key record -> record -> ReaderT backend m ()+    insertKey+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> record -> ReaderT backend m ()      -- | Put the record in the database with the given key.     -- Unlike 'replace', if a record with the given key does not@@ -453,8 +488,10 @@     -- > +-----+------+-----+     -- > |3    |X     |999  |     -- > +-----+------+-----+-    repsert :: forall record m. (MonadIO m, PersistRecordBackend record backend)-            => Key record -> record -> ReaderT backend m ()+    repsert+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> record -> ReaderT backend m ()      -- | Put many entities into the database.     --@@ -484,7 +521,8 @@     -- > |999  |Mr. X           |999      |     -- > +-----+----------------+---------+     repsertMany-        :: forall record m. (MonadIO m, PersistRecordBackend record backend)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => [(Key record, record)] -> ReaderT backend m ()     repsertMany = mapM_ (uncurry repsert) @@ -509,8 +547,10 @@     -- > +-----+------+-----+     -- > |2    |Simon |41   |     -- > +-----+------+-----+-    replace :: forall record m. (MonadIO m, PersistRecordBackend record backend)-            => Key record -> record -> ReaderT backend m ()+    replace+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> record -> ReaderT backend m ()      -- | Delete a specific record by identifier. Does nothing if record does     -- not exist.@@ -529,8 +569,10 @@     -- > +-----+------+-----+     -- > |2    |Simon |41   |     -- > +-----+------+-----+-    delete :: forall record m. (MonadIO m, PersistRecordBackend record backend)-           => Key record -> ReaderT backend m ()+    delete+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> ReaderT backend m ()      -- | Update individual fields on a specific record.     --@@ -552,8 +594,10 @@     -- > +-----+------+-----+     -- > |2    |Simon |41   |     -- > +-----+------+-----+-    update :: forall record m. (MonadIO m, PersistRecordBackend record backend)-           => Key record -> [Update record] -> ReaderT backend m ()+    update+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> [Update record] -> ReaderT backend m ()      -- | Update individual fields on a specific record, and retrieve the     -- updated value from the database.@@ -579,13 +623,14 @@     -- > +-----+------+-----+     -- > |2    |Simon |41   |     -- > +-----+------+-----+-    updateGet :: forall record m. (MonadIO m, PersistRecordBackend record backend)-              => Key record -> [Update record] -> ReaderT backend m record+    updateGet+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)+        => Key record -> [Update record] -> ReaderT backend m record     updateGet key ups = do         update key ups         get key >>= maybe (liftIO $ throwIO $ KeyNotFound $ show key) return - -- | Same as 'get', but for a non-null (not Maybe) foreign key. -- Unsafe unless your database is enforcing that the foreign key is valid. --@@ -612,14 +657,18 @@ -- mrx <- getJustUnknown -- -- This just throws an error.-getJust :: forall record backend m.-  ( PersistStoreRead backend-  , PersistRecordBackend record backend-  , MonadIO m)-  => Key record -> ReaderT backend m record-getJust key = get key >>= maybe-  (liftIO $ throwIO $ PersistForeignConstraintUnmet $ T.pack $ show key)-  return+getJust+    :: forall record backend m+     . ( PersistStoreRead backend+       , PersistRecordBackend record backend+       , MonadIO m+       )+    => Key record -> ReaderT backend m record+getJust key =+    get key+        >>= maybe+            (liftIO $ throwIO $ PersistForeignConstraintUnmet $ T.pack $ show key)+            return  -- | Same as 'getJust', but returns an 'Entity' instead of just the record. --@@ -641,41 +690,46 @@ -- > +----+------+-----+ -- > |  1 | SPJ  |  40 | -- > +----+------+-----+-getJustEntity :: forall record backend m.-  ( PersistEntityBackend record ~ BaseBackend backend-  , MonadIO m-  , PersistEntity record-  , PersistStoreRead backend)-  => Key record -> ReaderT backend m (Entity record)+getJustEntity+    :: forall record backend m+     . ( PersistEntityBackend record ~ BaseBackend backend+       , MonadIO m+       , PersistEntity record+       , PersistStoreRead backend+       )+    => Key record -> ReaderT backend m (Entity record) getJustEntity key = do-  record <- getJust key-  return $-    Entity-    { entityKey = key-    , entityVal = record-    }+    record <- getJust key+    return $+        Entity+            { entityKey = key+            , entityVal = record+            }  -- | Curry this to make a convenience function that loads an associated model. -- -- > foreign = belongsTo foreignId-belongsTo :: forall ent1 ent2 backend m.-  ( PersistStoreRead backend-  , PersistEntity ent1-  , PersistRecordBackend ent2 backend-  , MonadIO m-  ) => (ent1 -> Maybe (Key ent2)) -> ent1 -> ReaderT backend m (Maybe ent2)+belongsTo+    :: forall ent1 ent2 backend m+     . ( PersistStoreRead backend+       , PersistEntity ent1+       , PersistRecordBackend ent2 backend+       , MonadIO m+       )+    => (ent1 -> Maybe (Key ent2)) -> ent1 -> ReaderT backend m (Maybe ent2) belongsTo foreignKeyField model = case foreignKeyField model of     Nothing -> return Nothing     Just f -> get f  -- | Same as 'belongsTo', but uses @getJust@ and therefore is similarly unsafe.-belongsToJust :: forall ent1 ent2 backend m.-  ( PersistStoreRead backend-  , PersistEntity ent1-  , PersistRecordBackend ent2 backend-  , MonadIO m-  )-  => (ent1 -> Key ent2) -> ent1 -> ReaderT backend m ent2+belongsToJust+    :: forall ent1 ent2 backend m+     . ( PersistStoreRead backend+       , PersistEntity ent1+       , PersistRecordBackend ent2 backend+       , MonadIO m+       )+    => (ent1 -> Key ent2) -> ent1 -> ReaderT backend m ent2 belongsToJust getForeignKey model = getJust $ getForeignKey model  -- | Like @insert@, but returns the complete @Entity@.@@ -700,13 +754,15 @@ -- > +----+---------+-----+ -- > |  3 | Haskell |  81 | -- > +----+---------+-----+-insertEntity :: forall e backend m.-    ( PersistStoreWrite backend-    , PersistRecordBackend e backend-    , SafeToInsert e-    , MonadIO m-    , HasCallStack-    ) => e -> ReaderT backend m (Entity e)+insertEntity+    :: forall e backend m+     . ( PersistStoreWrite backend+       , PersistRecordBackend e backend+       , SafeToInsert e+       , MonadIO m+       , HasCallStack+       )+    => e -> ReaderT backend m (Entity e) insertEntity e = do     eid <- insert e     Maybe.fromMaybe (error errorMessage) <$> getEntity eid@@ -732,11 +788,13 @@ -- > +----+------+-----+ -- > |  1 | SPJ  |  40 | -- > +----+------+-----+-getEntity :: forall e backend m.-    ( PersistStoreRead backend-    , PersistRecordBackend e backend-    , MonadIO m-    ) => Key e -> ReaderT backend m (Maybe (Entity e))+getEntity+    :: forall e backend m+     . ( PersistStoreRead backend+       , PersistRecordBackend e backend+       , MonadIO m+       )+    => Key e -> ReaderT backend m (Maybe (Entity e)) getEntity key = do     maybeModel <- get key     return $ fmap (key `Entity`) maybeModel@@ -766,19 +824,19 @@ -- > |3    |Dave  |50   | -- > +-----+------+-----+ insertRecord-  :: forall record backend m.-   ( PersistEntityBackend record ~ BaseBackend backend-   , PersistEntity record-   , MonadIO m-   , PersistStoreWrite backend-   , SafeToInsert record-   , HasCallStack-   )-  => record -> ReaderT backend m record+    :: forall record backend m+     . ( PersistEntityBackend record ~ BaseBackend backend+       , PersistEntity record+       , MonadIO m+       , PersistStoreWrite backend+       , SafeToInsert record+       , HasCallStack+       )+    => record -> ReaderT backend m record insertRecord record = do-  k <- insert record-  let errorMessage =-          "persistent: failed to retrieve a record despite receiving a key from the database"-  mentity <- get k-  return $ Maybe.fromMaybe (error errorMessage) mentity-+    k <- insert record+    let+        errorMessage =+            "persistent: failed to retrieve a record despite receiving a key from the database"+    mentity <- get k+    return $ Maybe.fromMaybe (error errorMessage) mentity
Database/Persist/Class/PersistUnique.hs view
@@ -3,11 +3,11 @@ {-# LANGUAGE TypeOperators #-}  module Database.Persist.Class.PersistUnique-    ( PersistUniqueRead(..)-    , PersistUniqueWrite(..)-    , OnlyOneUniqueKey(..)+    ( PersistUniqueRead (..)+    , PersistUniqueWrite (..)+    , OnlyOneUniqueKey (..)     , onlyOneUniqueDef-    , AtLeastOneUniqueKey(..)+    , AtLeastOneUniqueKey (..)     , atLeastOneUniqueDef     , NoUniqueKeysError     , MultipleUniqueKeysError@@ -23,18 +23,18 @@     , defaultPutMany     , persistUniqueKeyValues     )-    where+where  import Control.Monad (liftM) import Control.Monad.IO.Class (MonadIO) import Control.Monad.Trans.Reader (ReaderT) import Data.Function (on) import Data.List (deleteFirstsBy, (\\))-import Data.List.NonEmpty (NonEmpty(..))+import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NEL import qualified Data.Map as Map import Data.Maybe (catMaybes, isJust)-import GHC.TypeLits (ErrorMessage(..))+import GHC.TypeLits (ErrorMessage (..))  import Database.Persist.Class.PersistEntity import Database.Persist.Class.PersistStore@@ -54,8 +54,7 @@ -- SQL backends automatically create uniqueness constraints, but for MongoDB -- you must manually place a unique index on a field to have a uniqueness -- constraint.----class PersistStoreRead backend => PersistUniqueRead backend  where+class (PersistStoreRead backend) => PersistUniqueRead backend where     -- | Get a record by unique key, if available. Returns also the identifier.     --     -- === __Example usage__@@ -75,7 +74,8 @@     -- > |  1 | SPJ  |  40 |     -- > +----+------+-----+     getBy-        :: forall record m. (MonadIO m, PersistRecordBackend record backend)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => Unique record -> ReaderT backend m (Maybe (Entity record))      -- | Returns True if a record with this unique key exists, otherwise False.@@ -94,7 +94,8 @@     --     -- @since 2.14.5     existsBy-        :: forall record m. (MonadIO m, PersistRecordBackend record backend)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => Unique record -> ReaderT backend m Bool     existsBy uniq = isJust <$> getBy uniq @@ -107,8 +108,10 @@ --  determing the column of failure; -- --  * an exception will automatically abort the current SQL transaction.-class (PersistUniqueRead backend, PersistStoreWrite backend) =>-      PersistUniqueWrite backend  where+class+    (PersistUniqueRead backend, PersistStoreWrite backend) =>+    PersistUniqueWrite backend+    where     -- | Delete a specific record by unique key. Does nothing if no record     -- matches.     --@@ -127,7 +130,8 @@     -- > |2    |Simon |41   |     -- > +-----+------+-----+     deleteBy-        :: forall record m. (MonadIO m, PersistRecordBackend record backend)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend)         => Unique record -> ReaderT backend m ()      -- | Like 'insert', but returns 'Nothing' when the record@@ -152,7 +156,8 @@     --     -- Linus's record was inserted to <#dataset-persist-unique-1 dataset-1>, while SPJ wasn't because SPJ already exists in <#dataset-persist-unique-1 dataset-1>.     insertUnique-        :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)         => record -> ReaderT backend m (Maybe (Key record))     insertUnique datum = do         conflict <- checkUnique datum@@ -183,7 +188,8 @@     --     -- @since 2.14.5.0     insertUnique_-        :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)         => record -> ReaderT backend m (Maybe ())     insertUnique_ datum = do         conflict <- checkUnique datum@@ -241,7 +247,12 @@     -- that this record has multiple unique keys, and suggests that we look for     -- 'upsertBy' to select the unique key we want.     upsert-        :: forall record m. (MonadIO m, PersistRecordBackend record backend, OnlyOneUniqueKey record, SafeToInsert record)+        :: forall record m+         . ( MonadIO m+           , PersistRecordBackend record backend+           , OnlyOneUniqueKey record+           , SafeToInsert record+           )         => record         -- ^ new record to insert         -> [Update record]@@ -308,7 +319,8 @@     -- > |3    |X    |999  |     -- > +-----+-----+-----+     upsertBy-        :: forall record m. (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)+        :: forall record m+         . (MonadIO m, PersistRecordBackend record backend, SafeToInsert record)         => Unique record         -- ^ uniqueness constraint to find by         -> record@@ -326,11 +338,11 @@     --     -- @since 2.8.1     putMany-        :: forall record m.-        ( MonadIO m-        , PersistRecordBackend record backend-        , SafeToInsert record-        )+        :: forall record m+         . ( MonadIO m+           , PersistRecordBackend record backend+           , SafeToInsert record+           )         => [record]         -- ^ A list of the records you want to insert or replace.         -> ReaderT backend m ()@@ -342,7 +354,7 @@ -- instances for records that have 0 or multiple unique keys. -- -- @since 2.10.0-class PersistEntity record => OnlyOneUniqueKey record where+class (PersistEntity record) => OnlyOneUniqueKey record where     onlyUniqueP :: record -> Unique record  -- | Given a proxy for a 'PersistEntity' record, this returns the sole@@ -366,7 +378,7 @@     'Text "The entity "         ':<>: 'ShowType ty         ':<>: 'Text " does not have any unique keys."-    ':$$: 'Text "The function you are trying to call requires a unique key "+        ':$$: 'Text "The function you are trying to call requires a unique key "         ':<>: 'Text "to be defined on the entity."  -- | This is an error message. It is used when an entity has multiple@@ -377,9 +389,9 @@     'Text "The entity "         ':<>: 'ShowType ty         ':<>: 'Text " has multiple unique keys."-    ':$$: 'Text "The function you are trying to call requires only a single "+        ':$$: 'Text "The function you are trying to call requires only a single "         ':<>: 'Text "unique key."-    ':$$: 'Text "There is probably a variant of the function with 'By' "+        ':$$: 'Text "There is probably a variant of the function with 'By' "         ':<>: 'Text "appended that will allow you to select a unique key "         ':<>: 'Text "for the operation." @@ -390,7 +402,7 @@ -- 0 unique keys. -- -- @since 2.10.0-class PersistEntity record => AtLeastOneUniqueKey record where+class (PersistEntity record) => AtLeastOneUniqueKey record where     requireUniquesP :: record -> NonEmpty (Unique record)  -- | Given a proxy for a record that has an instance of@@ -404,7 +416,7 @@     -> NonEmpty UniqueDef atLeastOneUniqueDef prxy =     case getEntityUniques (entityDef prxy) of-        (x:xs) -> x :| xs+        (x : xs) -> x :| xs         _ ->             error "impossible due to AtLeastOneUniqueKey record constraint" @@ -423,13 +435,13 @@ -- -- First three lines return 'Left' because there're duplicates in given record's uniqueness constraints. While the last line returns a new key as 'Right'. insertBy-    :: forall record backend m.-    ( MonadIO m-    , PersistUniqueWrite backend-    , PersistRecordBackend record backend-    , AtLeastOneUniqueKey record-    , SafeToInsert record-    )+    :: forall record backend m+     . ( MonadIO m+       , PersistUniqueWrite backend+       , PersistRecordBackend record backend+       , AtLeastOneUniqueKey record+       , SafeToInsert record+       )     => record -> ReaderT backend m (Either (Entity record) (Key record)) insertBy val = do     res <- getByValue val@@ -469,7 +481,6 @@ -- > +----+-------+-----+ -- > |  3 | Alexa |   3 | -- > +----+-------+-----+- insertUniqueEntity     :: forall record backend m      . ( MonadIO m@@ -480,7 +491,7 @@     => record     -> ReaderT backend m (Maybe (Entity record)) insertUniqueEntity datum =-  fmap (\key -> Entity key datum) `liftM` insertUnique datum+    fmap (\key -> Entity key datum) `liftM` insertUnique datum  -- | Return the single unique key for a record. --@@ -497,12 +508,12 @@ -- @onlyUnique@ doesn't work if there're more than two constraints. It will -- fail with a type error instead. onlyUnique-    :: forall record backend m.-    ( MonadIO m-    , PersistUniqueWrite backend-    , PersistRecordBackend record backend-    , OnlyOneUniqueKey record-    )+    :: forall record backend m+     . ( MonadIO m+       , PersistUniqueWrite backend+       , PersistRecordBackend record backend+       , OnlyOneUniqueKey record+       )     => record -> ReaderT backend m (Unique record) onlyUnique = pure . onlyUniqueP @@ -528,15 +539,16 @@ -- > |  1 | SPJ  |  40 | -- > +----+------+-----+ getByValue-    :: forall record m backend.-    ( MonadIO m-    , PersistUniqueRead backend-    , PersistRecordBackend record backend-    , AtLeastOneUniqueKey record-    )+    :: forall record m backend+     . ( MonadIO m+       , PersistUniqueRead backend+       , PersistRecordBackend record backend+       , AtLeastOneUniqueKey record+       )     => record -> ReaderT backend m (Maybe (Entity record)) getByValue record = do-    let uniqs = requireUniquesP record+    let+        uniqs = requireUniquesP record     getByValueUniques (NEL.toList uniqs)  -- | Retrieve a record from the database using the given unique keys. It@@ -548,18 +560,18 @@ -- -- @since 2.10.0 getByValueUniques-    :: forall record backend m.-    ( MonadIO m-    , PersistUniqueRead backend-    , PersistRecordBackend record backend-    )+    :: forall record backend m+     . ( MonadIO m+       , PersistUniqueRead backend+       , PersistRecordBackend record backend+       )     => [Unique record]     -> ReaderT backend m (Maybe (Entity record)) getByValueUniques uniqs =     checkUniques uniqs   where     checkUniques [] = return Nothing-    checkUniques (x:xs) = do+    checkUniques (x : xs) = do         y <- getBy x         case y of             Nothing -> checkUniques xs@@ -574,10 +586,12 @@ -- -- @since 1.2.2.0 replaceUnique-    :: forall record backend m. ( MonadIO m+    :: forall record backend m+     . ( MonadIO m        , Eq (Unique record)        , PersistRecordBackend record backend-       , PersistUniqueWrite backend )+       , PersistUniqueWrite backend+       )     => Key record -> record -> ReaderT backend m (Maybe (Unique record)) replaceUnique key datumNew = getJust key >>= replaceOriginal   where@@ -609,19 +623,23 @@ -- -- > mSpjConst <- checkUnique $ User "SPJ" 60 checkUnique-    :: forall record backend m. ( MonadIO m+    :: forall record backend m+     . ( MonadIO m        , PersistRecordBackend record backend-       , PersistUniqueRead backend)+       , PersistUniqueRead backend+       )     => record -> ReaderT backend m (Maybe (Unique record)) checkUnique = checkUniqueKeys . persistUniqueKeys  checkUniqueKeys-    :: forall record backend m. ( MonadIO m+    :: forall record backend m+     . ( MonadIO m        , PersistUniqueRead backend-       , PersistRecordBackend record backend)+       , PersistRecordBackend record backend+       )     => [Unique record] -> ReaderT backend m (Maybe (Unique record)) checkUniqueKeys [] = return Nothing-checkUniqueKeys (x:xs) = do+checkUniqueKeys (x : xs) = do     y <- getBy x     case y of         Nothing -> checkUniqueKeys xs@@ -651,27 +669,31 @@ -- -- @since 2.11.0.0 checkUniqueUpdateable-    :: forall record backend m. ( MonadIO m+    :: forall record backend m+     . ( MonadIO m        , PersistRecordBackend record backend-       , PersistUniqueRead backend)+       , PersistUniqueRead backend+       )     => Entity record -> ReaderT backend m (Maybe (Unique record)) checkUniqueUpdateable (Entity key record) =     checkUniqueKeysUpdateable key (persistUniqueKeys record)  checkUniqueKeysUpdateable-    :: forall record backend m. ( MonadIO m+    :: forall record backend m+     . ( MonadIO m        , PersistUniqueRead backend-       , PersistRecordBackend record backend)+       , PersistRecordBackend record backend+       )     => Key record -> [Unique record] -> ReaderT backend m (Maybe (Unique record)) checkUniqueKeysUpdateable _ [] = return Nothing-checkUniqueKeysUpdateable key (x:xs) = do+checkUniqueKeysUpdateable key (x : xs) = do     y <- getBy x     case y of         Nothing ->             checkUniqueKeysUpdateable key xs         Just (Entity k _)-          | key == k ->-              checkUniqueKeysUpdateable key xs+            | key == k ->+                checkUniqueKeysUpdateable key xs         Just _ ->             return (Just x) @@ -688,10 +710,14 @@        , PersistUniqueRead backend        , SafeToInsert record        )-    => Unique record   -- ^ uniqueness constraint to find by-    -> record          -- ^ new record to insert-    -> [Update record] -- ^ updates to perform if the record already exists-    -> ReaderT backend m (Entity record) -- ^ the record in the database after the operation+    => Unique record+    -- ^ uniqueness constraint to find by+    -> record+    -- ^ new record to insert+    -> [Update record]+    -- ^ updates to perform if the record already exists+    -> ReaderT backend m (Entity record)+    -- ^ the record in the database after the operation defaultUpsertBy uniqueKey record updates = do     mrecord <- getBy uniqueKey     maybe (insertEntity record) (`updateGetEntity` updates) mrecord@@ -704,17 +730,18 @@ -- * For pre-existing records, issue a 'replace' for each old key and new record -- * For new records, issue a bulk 'insertMany_' defaultPutMany-    :: forall record backend m. ( PersistEntityBackend record ~ BaseBackend backend-      , PersistEntity record-      , MonadIO m-      , PersistStoreWrite backend-      , PersistUniqueRead backend-      , SafeToInsert record-      )+    :: forall record backend m+     . ( PersistEntityBackend record ~ BaseBackend backend+       , PersistEntity record+       , MonadIO m+       , PersistStoreWrite backend+       , PersistUniqueRead backend+       , SafeToInsert record+       )     => [record]     -> ReaderT backend m ()-defaultPutMany []   = return ()-defaultPutMany rsD@(e:_)  = do+defaultPutMany [] = return ()+defaultPutMany rsD@(e : _) = do     case persistUniqueKeys e of         [] -> insertMany_ rsD         _ -> go@@ -723,30 +750,41 @@         -- deduplicate the list of records in Haskell by unique key. The         -- previous implementation used Data.List.nubBy which is O(n^2)         -- complexity.-        let rs = map snd-                . Map.toList-                . Map.fromList-                . map (\r -> (persistUniqueKeyValues r, r))-                $ rsD+        let+            rs =+                map snd+                    . Map.toList+                    . Map.fromList+                    . map (\r -> (persistUniqueKeyValues r, r))+                    $ rsD          -- lookup record(s) by their unique key         mEsOld <- mapM (getByValueUniques . persistUniqueKeys) rs          -- find pre-existing entities and corresponding (incoming) records-        let merge (Just x) y = Just (x, y)-            merge _        _ = Nothing-        let mEsOldAndRs = zipWith merge mEsOld rs-        let esOldAndRs = catMaybes mEsOldAndRs+        let+            merge (Just x) y = Just (x, y)+            merge _ _ = Nothing+        let+            mEsOldAndRs = zipWith merge mEsOld rs+        let+            esOldAndRs = catMaybes mEsOldAndRs          -- determine records to insert-        let esOld = fmap fst esOldAndRs-        let rsOld = fmap entityVal esOld-        let rsNew = deleteFirstsBy ((==) `on` persistUniqueKeyValues) rs rsOld+        let+            esOld = fmap fst esOldAndRs+        let+            rsOld = fmap entityVal esOld+        let+            rsNew = deleteFirstsBy ((==) `on` persistUniqueKeyValues) rs rsOld          -- determine records to update-        let rsUpd = fmap snd esOldAndRs-        let ksOld = fmap entityKey esOld-        let krs   = zip ksOld rsUpd+        let+            rsUpd = fmap snd esOldAndRs+        let+            ksOld = fmap entityKey esOld+        let+            krs = zip ksOld rsUpd          -- insert `new` records         insertMany_ rsNew@@ -756,5 +794,5 @@ -- | This function returns a list of 'PersistValue' that correspond to the -- 'Unique' keys on that record. This is useful for comparing two @record@s -- for equality only on the basis of their 'Unique' keys.-persistUniqueKeyValues :: PersistEntity record => record -> [PersistValue]+persistUniqueKeyValues :: (PersistEntity record) => record -> [PersistValue] persistUniqueKeyValues = concatMap persistUniqueToValues . persistUniqueKeys
Database/Persist/Compatible.hs view
@@ -1,9 +1,8 @@ module Database.Persist.Compatible-    ( Compatible(..)+    ( Compatible (..)     , makeCompatibleInstances     , makeCompatibleKeyInstances     ) where -import Database.Persist.Compatible.Types import Database.Persist.Compatible.TH-+import Database.Persist.Compatible.Types
Database/Persist/Compatible/TH.hs view
@@ -31,33 +31,70 @@ -- @since 2.12 makeCompatibleInstances :: Q Type -> Q [Dec] makeCompatibleInstances compatibleType = do-        (b, s) <- compatibleType >>= \case+    (b, s) <-+        compatibleType >>= \case             ForallT _ _ (AppT (AppT (ConT conTName) b) s) ->                 if conTName == ''Compatible                     then pure (b, s)-                    else fail $-                                "Cannot make `deriving via` instances if the argument is " <>-                                "not of the form `forall v1 ... vn. Compatible sub sup`"+                    else+                        fail $+                            "Cannot make `deriving via` instances if the argument is "+                                <> "not of the form `forall v1 ... vn. Compatible sub sup`"             AppT (AppT (ConT conTName) b) s ->                 if conTName == ''Compatible                     then pure (b, s)-                    else fail $-                                "Cannot make `deriving via` instances if the argument is " <>-                                "not of the form `Compatible sub sup`"-            _ -> fail $-                        "Cannot make `deriving via` instances if the argument is " <>-                        "not of the form `Compatible sub sup`"+                    else+                        fail $+                            "Cannot make `deriving via` instances if the argument is "+                                <> "not of the form `Compatible sub sup`"+            _ ->+                fail $+                    "Cannot make `deriving via` instances if the argument is "+                        <> "not of the form `Compatible sub sup`" -        [d|-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b)) => HasPersistBackend $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistStoreRead $(return b)) => PersistStoreRead $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistQueryRead $(return b)) => PersistQueryRead $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistUniqueRead $(return b)) => PersistUniqueRead $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistStoreWrite $(return b)) => PersistStoreWrite $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistQueryWrite $(return b)) => PersistQueryWrite $(return s)-                deriving via (Compatible $(return b) $(return s)) instance (HasPersistBackend $(return b), PersistUniqueWrite $(return b)) => PersistUniqueWrite $(return s)-            |]+    [d|+        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b)) => HasPersistBackend $(return s) +        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistStoreRead $(return b))+                => PersistStoreRead $(return s)++        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistQueryRead $(return b))+                => PersistQueryRead $(return s)++        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistUniqueRead $(return b))+                => PersistUniqueRead $(return s)++        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistStoreWrite $(return b))+                => PersistStoreWrite $(return s)++        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistQueryWrite $(return b))+                => PersistQueryWrite $(return s)++        deriving via+            (Compatible $(return b) $(return s))+            instance+                (HasPersistBackend $(return b), PersistUniqueWrite $(return b))+                => PersistUniqueWrite $(return s)+        |]+ -- | Gives a bunch of useful instance declarations for a backend key based on -- its compatibility with another backend & key, using 'Compatible'. --@@ -73,35 +110,133 @@ -- @since 2.12 makeCompatibleKeyInstances :: Q Type -> Q [Dec] makeCompatibleKeyInstances compatibleType = do-    (b, s) <- compatibleType >>= \case-        ForallT _ _ (AppT (AppT (ConT conTName) b) s) ->-            if conTName == ''Compatible-                then pure (b, s)-                else fail $-                            "Cannot make `deriving via` instances if the argument is " <>-                            "not of the form `forall v1 ... vn. Compatible sub sup`"-        AppT (AppT (ConT conTName) b) s ->-            if conTName == ''Compatible-                then pure (b, s)-                else fail $-                            "Cannot make `deriving via` instances if the argument is " <>-                            "not of the form `Compatible sub sup`"-        _ -> fail $-                    "Cannot make `deriving via` instances if the argument is " <>-                    "not of the form `Compatible sub sup`"+    (b, s) <-+        compatibleType >>= \case+            ForallT _ _ (AppT (AppT (ConT conTName) b) s) ->+                if conTName == ''Compatible+                    then pure (b, s)+                    else+                        fail $+                            "Cannot make `deriving via` instances if the argument is "+                                <> "not of the form `forall v1 ... vn. Compatible sub sup`"+            AppT (AppT (ConT conTName) b) s ->+                if conTName == ''Compatible+                    then pure (b, s)+                    else+                        fail $+                            "Cannot make `deriving via` instances if the argument is "+                                <> "not of the form `Compatible sub sup`"+            _ ->+                fail $+                    "Cannot make `deriving via` instances if the argument is "+                        <> "not of the form `Compatible sub sup`"      [d|-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Show (BackendKey $(return b))) => Show (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Read (BackendKey $(return b))) => Read (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Eq (BackendKey $(return b))) => Eq (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Ord (BackendKey $(return b))) => Ord (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Num (BackendKey $(return b))) => Num (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Integral (BackendKey $(return b))) => Integral (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), PersistField (BackendKey $(return b))) => PersistField (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), PersistFieldSql (BackendKey $(return b))) => PersistFieldSql (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Real (BackendKey $(return b))) => Real (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Enum (BackendKey $(return b))) => Enum (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), Bounded (BackendKey $(return b))) => Bounded (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), ToJSON (BackendKey $(return b))) => ToJSON (BackendKey $(return s))-            deriving via (BackendKey (Compatible $(return b) $(return s))) instance (PersistCore $(return b), PersistCore $(return s), FromJSON (BackendKey $(return b))) => FromJSON (BackendKey $(return s))+        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Show (BackendKey $(return b))+                )+                => Show (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Read (BackendKey $(return b))+                )+                => Read (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                (PersistCore $(return b), PersistCore $(return s), Eq (BackendKey $(return b)))+                => Eq (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                (PersistCore $(return b), PersistCore $(return s), Ord (BackendKey $(return b)))+                => Ord (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                (PersistCore $(return b), PersistCore $(return s), Num (BackendKey $(return b)))+                => Num (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Integral (BackendKey $(return b))+                )+                => Integral (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , PersistField (BackendKey $(return b))+                )+                => PersistField (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , PersistFieldSql (BackendKey $(return b))+                )+                => PersistFieldSql (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Real (BackendKey $(return b))+                )+                => Real (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Enum (BackendKey $(return b))+                )+                => Enum (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , Bounded (BackendKey $(return b))+                )+                => Bounded (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , ToJSON (BackendKey $(return b))+                )+                => ToJSON (BackendKey $(return s))++        deriving via+            (BackendKey (Compatible $(return b) $(return s)))+            instance+                ( PersistCore $(return b)+                , PersistCore $(return s)+                , FromJSON (BackendKey $(return b))+                )+                => FromJSON (BackendKey $(return s))         |]
Database/Persist/Compatible/Types.hs view
@@ -1,4 +1,3 @@-{-# OPTIONS_GHC -Wno-unused-top-binds #-} {- You can't export a data family constructor, so there's an "unused" warning -} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleInstances #-}@@ -7,9 +6,10 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE UndecidableInstances #-}+{-# OPTIONS_GHC -Wno-unused-top-binds #-}  module Database.Persist.Compatible.Types-    ( Compatible(..)+    ( Compatible (..)     ) where  import Control.Monad.Trans.Reader (withReaderT)@@ -17,7 +17,6 @@ import Database.Persist.Class import Database.Persist.Sql.Class - -- | A newtype wrapper for compatible backends, mainly useful for @DerivingVia@. -- -- When writing a new backend that is 'BackendCompatible' with an existing backend,@@ -53,14 +52,17 @@ -- @ -- -- @since 2.12-newtype Compatible b s = Compatible { unCompatible :: s }+newtype Compatible b s = Compatible {unCompatible :: s} -instance (BackendCompatible b s, HasPersistBackend b) => HasPersistBackend (Compatible b s) where+instance+    (BackendCompatible b s, HasPersistBackend b)+    => HasPersistBackend (Compatible b s)+    where     type BaseBackend (Compatible b s) = BaseBackend b     persistBackend = persistBackend . projectBackend @b @s . unCompatible  instance (BackendCompatible b s, PersistCore b) => PersistCore (Compatible b s) where-    -- | A newtype wrapper around @'BackendKey' b@, mainly useful for @DerivingVia@.+    -- \| A newtype wrapper around @'BackendKey' b@, mainly useful for @DerivingVia@.     --     -- Similarly to @'Compatible' b s@, this data family instance is handy for deriving     -- instances for @'BackendKey' s@ by defining them in terms of @'BackendKey' b@.@@ -85,28 +87,44 @@     --     -- These instances will go through the compatible backend's key (in this case,     -- @'BackendKey' 'SqlBackend'@) for all their logic.-    newtype BackendKey (Compatible b s) = CompatibleKey { unCompatibleKey :: BackendKey b }+    newtype BackendKey (Compatible b s) = CompatibleKey {unCompatibleKey :: BackendKey b} -instance (HasPersistBackend b, BackendCompatible b s, PersistStoreRead b) => PersistStoreRead (Compatible b s) where+instance+    (HasPersistBackend b, BackendCompatible b s, PersistStoreRead b)+    => PersistStoreRead (Compatible b s)+    where     get = withReaderT (projectBackend @b @s . unCompatible) . get     getMany = withReaderT (projectBackend @b @s . unCompatible) . getMany -instance (HasPersistBackend b, BackendCompatible b s, PersistQueryRead b) => PersistQueryRead (Compatible b s) where-    selectSourceRes filts opts = withReaderT (projectBackend @b @s . unCompatible) $ selectSourceRes filts opts+instance+    (HasPersistBackend b, BackendCompatible b s, PersistQueryRead b)+    => PersistQueryRead (Compatible b s)+    where+    selectSourceRes filts opts =+        withReaderT (projectBackend @b @s . unCompatible) $ selectSourceRes filts opts     selectFirst filts opts = withReaderT (projectBackend @b @s . unCompatible) $ selectFirst filts opts     selectKeysRes filts opts = withReaderT (projectBackend @b @s . unCompatible) $ selectKeysRes filts opts     count = withReaderT (projectBackend @b @s . unCompatible) . count     exists = withReaderT (projectBackend @b @s . unCompatible) . exists -instance (HasPersistBackend b, BackendCompatible b s, PersistQueryWrite b) => PersistQueryWrite (Compatible b s) where+instance+    (HasPersistBackend b, BackendCompatible b s, PersistQueryWrite b)+    => PersistQueryWrite (Compatible b s)+    where     updateWhere filts updates = withReaderT (projectBackend @b @s . unCompatible) $ updateWhere filts updates     deleteWhere = withReaderT (projectBackend @b @s . unCompatible) . deleteWhere -instance (HasPersistBackend b, BackendCompatible b s, PersistUniqueRead b) => PersistUniqueRead (Compatible b s) where+instance+    (HasPersistBackend b, BackendCompatible b s, PersistUniqueRead b)+    => PersistUniqueRead (Compatible b s)+    where     getBy = withReaderT (projectBackend @b @s . unCompatible) . getBy     existsBy = withReaderT (projectBackend @b @s . unCompatible) . existsBy -instance (HasPersistBackend b, BackendCompatible b s, PersistStoreWrite b) => PersistStoreWrite (Compatible b s) where+instance+    (HasPersistBackend b, BackendCompatible b s, PersistStoreWrite b)+    => PersistStoreWrite (Compatible b s)+    where     insert = withReaderT (projectBackend @b @s . unCompatible) . insert     insert_ = withReaderT (projectBackend @b @s . unCompatible) . insert_     insertMany = withReaderT (projectBackend @b @s . unCompatible) . insertMany@@ -120,23 +138,75 @@     update k = withReaderT (projectBackend @b @s . unCompatible) . update k     updateGet k = withReaderT (projectBackend @b @s . unCompatible) . updateGet k -instance (HasPersistBackend b, BackendCompatible b s, PersistUniqueWrite b) => PersistUniqueWrite (Compatible b s) where+instance+    (HasPersistBackend b, BackendCompatible b s, PersistUniqueWrite b)+    => PersistUniqueWrite (Compatible b s)+    where     deleteBy = withReaderT (projectBackend @b @s . unCompatible) . deleteBy     insertUnique = withReaderT (projectBackend @b @s . unCompatible) . insertUnique     upsert rec = withReaderT (projectBackend @b @s . unCompatible) . upsert rec     upsertBy uniq rec = withReaderT (projectBackend @b @s . unCompatible) . upsertBy uniq rec     putMany = withReaderT (projectBackend @b @s . unCompatible) . putMany -deriving via (BackendKey b) instance (BackendCompatible b s, Show (BackendKey b)) => Show (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Read (BackendKey b)) => Read (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Integral (BackendKey b)) => Integral (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, PersistField (BackendKey b)) => PersistField (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, PersistFieldSql (BackendKey b)) => PersistFieldSql (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Real (BackendKey b)) => Real (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Enum (BackendKey b)) => Enum (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, Bounded (BackendKey b)) => Bounded (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, ToJSON (BackendKey b)) => ToJSON (BackendKey (Compatible b s))-deriving via (BackendKey b) instance (BackendCompatible b s, FromJSON (BackendKey b)) => FromJSON (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Show (BackendKey b))+        => Show (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Read (BackendKey b))+        => Read (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Eq (BackendKey b)) => Eq (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Ord (BackendKey b)) => Ord (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Num (BackendKey b)) => Num (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Integral (BackendKey b))+        => Integral (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, PersistField (BackendKey b))+        => PersistField (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, PersistFieldSql (BackendKey b))+        => PersistFieldSql (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Real (BackendKey b))+        => Real (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Enum (BackendKey b))+        => Enum (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, Bounded (BackendKey b))+        => Bounded (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, ToJSON (BackendKey b))+        => ToJSON (BackendKey (Compatible b s))+deriving via+    (BackendKey b)+    instance+        (BackendCompatible b s, FromJSON (BackendKey b))+        => FromJSON (BackendKey (Compatible b s))
Database/Persist/EntityDef.hs view
@@ -5,7 +5,9 @@ module Database.Persist.EntityDef     ( -- * The 'EntityDef' type       EntityDef+       -- * Construction+       -- * Accessors     , getEntityHaskellName     , getEntityDBName@@ -25,13 +27,15 @@     , entitiesPrimary     , keyAndEntityFields     , keyAndEntityFieldsDatabase-     -- * Setters++      -- * Setters     , setEntityId     , setEntityIdDef     , setEntityDBName     , overEntityFields+       -- * Related Types-    , EntityIdDef(..)+    , EntityIdDef (..)     ) where  import Data.List.NonEmpty (NonEmpty)@@ -43,7 +47,11 @@  import Database.Persist.Names import Database.Persist.Types.Base-       (ForeignDef, SourceSpan, UniqueDef(..), entityKeyFields)+    ( ForeignDef+    , SourceSpan+    , UniqueDef (..)+    , entityKeyFields+    )  -- | Retrieve the list of 'UniqueDef' from an 'EntityDef'. This does not include -- a @Primary@ key, if one is defined. A future version of @persistent@ will@@ -96,7 +104,7 @@ -- -- @since 2.13.0.0 setEntityDBName :: EntityNameDB -> EntityDef -> EntityDef-setEntityDBName db ed = ed { entityDB = db }+setEntityDBName db ed = ed{entityDB = db}  getEntityComments :: EntityDef -> Maybe Text getEntityComments = entityComments@@ -182,7 +190,7 @@     :: EntityIdDef     -> EntityDef     -> EntityDef-setEntityIdDef i ed = ed { entityId = i }+setEntityIdDef i ed = ed{entityId = i}  -- | --@@ -196,7 +204,7 @@ -- -- @since 2.13.0.0 setEntityFields :: [FieldDef] -> EntityDef -> EntityDef-setEntityFields fd ed = ed { entityFields = fd }+setEntityFields fd ed = ed{entityFields = fd}  -- | Perform a mapping function over all of the entity fields, as determined by -- 'getEntityFieldsDatabase'.
Database/Persist/EntityDef/Internal.hs view
@@ -7,13 +7,13 @@ -- -- @since 2.13.0.0 module Database.Persist.EntityDef.Internal-    ( EntityDef(..)+    ( EntityDef (..)     , entityPrimary     , entitiesPrimary     , keyAndEntityFields     , keyAndEntityFieldsDatabase     , toEmbedEntityDef-    , EntityIdDef(..)+    , EntityIdDef (..)     ) where  import Database.Persist.Types.Base
Database/Persist/FieldDef.hs view
@@ -4,44 +4,47 @@ module Database.Persist.FieldDef     ( -- * The 'FieldDef' type       FieldDef+       -- ** Setters     , setFieldAttrs     , overFieldAttrs     , addFieldAttr+       -- ** Helpers     , isFieldNullable     , isFieldMaybe     , isFieldNotGenerated     , isHaskellField+       -- * 'FieldCascade'-    , FieldCascade(..)+    , FieldCascade (..)     , renderFieldCascade     , renderCascadeAction     , noCascade-    , CascadeAction(..)+    , CascadeAction (..)     ) where  import Database.Persist.FieldDef.Internal  import Database.Persist.Types.Base-       ( FieldAttr(..)-       , FieldType(..)-       , IsNullable(..)-       , fieldAttrsContainsNullable-       , isHaskellField-       )+    ( FieldAttr (..)+    , FieldType (..)+    , IsNullable (..)+    , fieldAttrsContainsNullable+    , isHaskellField+    )  -- | Replace the 'FieldDef' 'FieldAttr' with the new list. -- -- @since 2.13.0.0 setFieldAttrs :: [FieldAttr] -> FieldDef -> FieldDef-setFieldAttrs fas fd = fd { fieldAttrs = fas }+setFieldAttrs fas fd = fd{fieldAttrs = fas}  -- | Modify the list of field attributes. -- -- @since 2.13.0.0 overFieldAttrs :: ([FieldAttr] -> [FieldAttr]) -> FieldDef -> FieldDef-overFieldAttrs k fd = fd { fieldAttrs = k (fieldAttrs fd) }+overFieldAttrs k fd = fd{fieldAttrs = k (fieldAttrs fd)}  -- | Add an attribute to the list of field attributes. --
Database/Persist/FieldDef/Internal.hs view
@@ -2,13 +2,13 @@ -- -- @since 2.13.0.0 module Database.Persist.FieldDef.Internal-    ( FieldDef(..)+    ( FieldDef (..)     , isFieldNotGenerated-    , FieldCascade(..)+    , FieldCascade (..)     , renderFieldCascade     , renderCascadeAction     , noCascade-    , CascadeAction(..)+    , CascadeAction (..)     ) where  import Database.Persist.Types.Base
Database/Persist/ImplicitIdDef.hs view
@@ -13,25 +13,29 @@ module Database.Persist.ImplicitIdDef     ( -- * The Type       ImplicitIdDef+       -- * Construction     , mkImplicitIdDef-    -- * Autoincrementing Integer Key++      -- * Autoincrementing Integer Key     , autoIncrementingInteger-    -- * Getters-    -- * Setters++      -- * Getters++      -- * Setters     , setImplicitIdDefMaxLen     , unsafeClearDefaultImplicitId     ) where  import Language.Haskell.TH +import Database.Persist.Class (BackendKey) import Database.Persist.ImplicitIdDef.Internal+import Database.Persist.Names import Database.Persist.Types.Base-    ( FieldType(..)-    , SqlType(..)+    ( FieldType (..)+    , SqlType (..)     )-import Database.Persist.Class (BackendKey)-import Database.Persist.Names  -- | This is the default variant. Setting the implicit ID definition to this -- value should not have any change at all on how entities are defined by@@ -46,10 +50,10 @@         , iidFieldSqlType =             SqlInt64         , iidType = \isMpsGeneric mpsBackendType ->-            ConT ''BackendKey `AppT`-                if isMpsGeneric-                then VarT (mkName "backend")-                else mpsBackendType+            ConT ''BackendKey+                `AppT` if isMpsGeneric+                    then VarT (mkName "backend")+                    else mpsBackendType         , iidDefault =             Nothing         , iidMaxLen =
Database/Persist/ImplicitIdDef/Internal.hs view
@@ -4,7 +4,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StrictData #-} {-# LANGUAGE TypeApplications #-}-{-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeOperators #-}  -- | WARNING: This is an @Internal@ module. As such, breaking changes to the API@@ -16,14 +15,14 @@ -- @since 2.13.0.0 module Database.Persist.ImplicitIdDef.Internal where +import Data.Foldable (asum) import Data.Proxy import Data.Text (Text) import qualified Data.Text as Text+import Data.Typeable (eqT) import Language.Haskell.TH (Type) import LiftType import Type.Reflection-import Data.Typeable (eqT)-import Data.Foldable (asum)  import Database.Persist.Class.PersistField (PersistField) import Database.Persist.Names@@ -152,7 +151,8 @@ -- -- @since 2.13.0.0 mkImplicitIdDef-    :: forall t. (Typeable t, PersistFieldSql t)+    :: forall t+     . (Typeable t, PersistFieldSql t)     => Text     -- ^ The default expression to use for columns. Should be valid SQL in the     -- language you're using.@@ -186,7 +186,7 @@     :: Integer     -> ImplicitIdDef     -> ImplicitIdDef-setImplicitIdDefMaxLen i iid = iid { iidMaxLen = Just i }+setImplicitIdDefMaxLen i iid = iid{iidMaxLen = Just i}  -- |  This function converts a 'Typeable' type into a @persistent@ -- representation of the type of a field - 'FieldTyp'.@@ -224,4 +224,4 @@ -- -- @since 2.13.0.0 unsafeClearDefaultImplicitId :: ImplicitIdDef -> ImplicitIdDef-unsafeClearDefaultImplicitId iid = iid { iidDefault = Nothing }+unsafeClearDefaultImplicitId iid = iid{iidDefault = Nothing}
Database/Persist/Names.hs view
@@ -8,6 +8,7 @@  import Data.Text (Text) import Language.Haskell.TH.Syntax (Lift)+ -- Bring `Lift (Map k v)` instance into scope, as well as `Lift Text` -- instance on pre-1.2.4 versions of `text` import Instances.TH.Lift ()@@ -22,7 +23,7 @@ -- will use for a field. -- -- @since 2.12.0.0-newtype FieldNameDB = FieldNameDB { unFieldNameDB :: Text }+newtype FieldNameDB = FieldNameDB {unFieldNameDB :: Text}     deriving (Show, Eq, Read, Ord, Lift)  -- | @since 2.12.0.0@@ -33,21 +34,21 @@ -- will use for a field. -- -- @since 2.12.0.0-newtype FieldNameHS = FieldNameHS { unFieldNameHS :: Text }+newtype FieldNameHS = FieldNameHS {unFieldNameHS :: Text}     deriving (Show, Eq, Read, Ord, Lift)  -- | An 'EntityNameHS' represents the Haskell-side name that @persistent@ -- will use for an entity. -- -- @since 2.12.0.0-newtype EntityNameHS = EntityNameHS { unEntityNameHS :: Text }+newtype EntityNameHS = EntityNameHS {unEntityNameHS :: Text}     deriving (Show, Eq, Read, Ord, Lift)  -- | An 'EntityNameDB' represents the datastore-side name that @persistent@ -- will use for an entity. -- -- @since 2.12.0.0-newtype EntityNameDB = EntityNameDB { unEntityNameDB :: Text }+newtype EntityNameDB = EntityNameDB {unEntityNameDB :: Text}     deriving (Show, Eq, Read, Ord, Lift)  instance DatabaseName EntityNameDB where@@ -57,16 +58,16 @@ -- will use for a constraint. -- -- @since 2.12.0.0-newtype ConstraintNameDB = ConstraintNameDB { unConstraintNameDB :: Text }-  deriving (Show, Eq, Read, Ord, Lift)+newtype ConstraintNameDB = ConstraintNameDB {unConstraintNameDB :: Text}+    deriving (Show, Eq, Read, Ord, Lift)  -- | @since 2.12.0.0 instance DatabaseName ConstraintNameDB where-  escapeWith f (ConstraintNameDB n) = f n+    escapeWith f (ConstraintNameDB n) = f n  -- | An 'ConstraintNameHS' represents the Haskell-side name that @persistent@ -- will use for a constraint. -- -- @since 2.12.0.0-newtype ConstraintNameHS = ConstraintNameHS { unConstraintNameHS :: Text }-  deriving (Show, Eq, Read, Ord, Lift)+newtype ConstraintNameHS = ConstraintNameHS {unConstraintNameHS :: Text}+    deriving (Show, Eq, Read, Ord, Lift)
Database/Persist/PersistValue.hs view
@@ -1,33 +1,33 @@-{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE CPP #-}+{-# LANGUAGE PatternSynonyms #-}  -- | This module contains an intermediate representation of values before the -- backends serialize them into explicit database types. -- -- @since 2.13.0.0 module Database.Persist.PersistValue-    ( PersistValue(.., PersistLiteral, PersistLiteralEscaped, PersistDbSpecific)+    ( PersistValue (.., PersistLiteral, PersistLiteralEscaped, PersistDbSpecific)     , fromPersistValueText-    , LiteralType(..)+    , LiteralType (..)     ) where  import Control.DeepSeq+import qualified Data.Aeson as A+import Data.Bits (shiftL, shiftR)+import Data.ByteString as BS (ByteString, foldl')+import qualified Data.ByteString as BS import qualified Data.ByteString.Base64 as B64-import qualified Data.Text.Encoding as TE import qualified Data.ByteString.Char8 as BS8-import qualified Data.Vector as V import Data.Int (Int64) import qualified Data.Scientific-import Data.Text.Encoding.Error (lenientDecode)-import Data.Bits (shiftL, shiftR)-import Numeric (readHex, showHex)-import qualified Data.Text as Text import Data.Text (Text)-import Data.ByteString as BS (ByteString, foldl')+import qualified Data.Text as Text+import qualified Data.Text.Encoding as TE+import Data.Text.Encoding.Error (lenientDecode) import Data.Time (Day, TimeOfDay, UTCTime)-import Web.PathPieces (PathPiece(..))-import qualified Data.Aeson as A-import qualified Data.ByteString as BS+import qualified Data.Vector as V+import Numeric (readHex, showHex)+import Web.PathPieces (PathPiece (..))  #if MIN_VERSION_aeson(2,0,0) import qualified Data.Aeson.Key as K@@ -37,11 +37,11 @@ #endif  import Web.HttpApiData-       ( FromHttpApiData(..)-       , ToHttpApiData(..)-       , parseUrlPieceMaybe-       , readTextData-       )+    ( FromHttpApiData (..)+    , ToHttpApiData (..)+    , parseUrlPieceMaybe+    , readTextData+    )  -- | A raw value which can be stored in any backend and can be marshalled to -- and from a 'PersistField'.@@ -58,62 +58,61 @@     | PersistNull     | PersistList [PersistValue]     | PersistMap [(Text, PersistValue)]-    | PersistObjectId ByteString-    -- ^ Intended especially for MongoDB backend-    | PersistArray [PersistValue]-    -- ^ Intended especially for PostgreSQL backend for text arrays-    | PersistLiteral_ LiteralType ByteString-    -- ^ This constructor is used to specify some raw literal value for the-    -- backend. The 'LiteralType' value specifies how the value should be-    -- escaped. This can be used to make special, custom types avaialable-    -- in the back end.-    ---    -- @since 2.12.0.0+    | -- | Intended especially for MongoDB backend+      PersistObjectId ByteString+    | -- | Intended especially for PostgreSQL backend for text arrays+      PersistArray [PersistValue]+    | -- | This constructor is used to specify some raw literal value for the+      -- backend. The 'LiteralType' value specifies how the value should be+      -- escaped. This can be used to make special, custom types avaialable+      -- in the back end.+      --+      -- @since 2.12.0.0+      PersistLiteral_ LiteralType ByteString     deriving (Show, Read, Eq, Ord)  -- | -- @since 2.14.4.0 instance NFData PersistValue where-  rnf val = case val of-    PersistText txt -> rnf txt-    PersistByteString bs -> rnf bs-    PersistInt64 i -> rnf i-    PersistDouble d -> rnf d-    PersistRational q -> rnf q-    PersistBool b -> rnf b-    PersistDay d -> rnf d-    PersistTimeOfDay t -> rnf t-    PersistUTCTime t -> rnf t-    PersistNull -> ()-    PersistList vals -> rnf vals-    PersistMap vals -> rnf vals-    PersistObjectId bs -> rnf bs-    PersistArray vals -> rnf vals-    PersistLiteral_ ty bs -> ty `seq` rnf bs-+    rnf val = case val of+        PersistText txt -> rnf txt+        PersistByteString bs -> rnf bs+        PersistInt64 i -> rnf i+        PersistDouble d -> rnf d+        PersistRational q -> rnf q+        PersistBool b -> rnf b+        PersistDay d -> rnf d+        PersistTimeOfDay t -> rnf t+        PersistUTCTime t -> rnf t+        PersistNull -> ()+        PersistList vals -> rnf vals+        PersistMap vals -> rnf vals+        PersistObjectId bs -> rnf bs+        PersistArray vals -> rnf vals+        PersistLiteral_ ty bs -> ty `seq` rnf bs  -- | A type that determines how a backend should handle the literal. -- -- @since 2.12.0.0 data LiteralType-    = Escaped-    -- ^ The accompanying value will be escaped before inserting into the-    -- database. This is the correct default choice to use.-    ---    -- @since 2.12.0.0-    | Unescaped-    -- ^ The accompanying value will not be escaped when inserting into the-    -- database. This is potentially dangerous - use this with care.-    ---    -- @since 2.12.0.0-    | DbSpecific-    -- ^ The 'DbSpecific' constructor corresponds to the legacy-    -- 'PersistDbSpecific' constructor. We need to keep this around because-    -- old databases may have serialized JSON representations that-    -- reference this. We don't want to break the ability of a database to-    -- load rows.-    ---    -- @since 2.12.0.0+    = -- | The accompanying value will be escaped before inserting into the+      -- database. This is the correct default choice to use.+      --+      -- @since 2.12.0.0+      Escaped+    | -- | The accompanying value will not be escaped when inserting into the+      -- database. This is potentially dangerous - use this with care.+      --+      -- @since 2.12.0.0+      Unescaped+    | -- | The 'DbSpecific' constructor corresponds to the legacy+      -- 'PersistDbSpecific' constructor. We need to keep this around because+      -- old databases may have serialized JSON representations that+      -- reference this. We don't want to break the ability of a database to+      -- load rows.+      --+      -- @since 2.12.0.0+      DbSpecific     deriving (Show, Read, Eq, Ord)  -- | This pattern synonym used to be a data constructor for the@@ -129,8 +128,9 @@ -- -- @since 2.12.0.0 pattern PersistDbSpecific :: ByteString -> PersistValue-pattern PersistDbSpecific bs <- PersistLiteral_ _ bs where-    PersistDbSpecific bs = PersistLiteral_ DbSpecific bs+pattern PersistDbSpecific bs <- PersistLiteral_ _ bs+    where+        PersistDbSpecific bs = PersistLiteral_ DbSpecific bs  -- | This pattern synonym used to be a data constructor on 'PersistValue', -- but was changed into a catch-all pattern synonym to allow backwards@@ -139,8 +139,9 @@ -- -- @since 2.12.0.0 pattern PersistLiteralEscaped :: ByteString -> PersistValue-pattern PersistLiteralEscaped bs <- PersistLiteral_ _ bs where-    PersistLiteralEscaped bs = PersistLiteral_ Escaped bs+pattern PersistLiteralEscaped bs <- PersistLiteral_ _ bs+    where+        PersistLiteralEscaped bs = PersistLiteral_ Escaped bs  -- | This pattern synonym used to be a data constructor on 'PersistValue', -- but was changed into a catch-all pattern synonym to allow backwards@@ -149,10 +150,14 @@ -- -- @since 2.12.0.0 pattern PersistLiteral :: ByteString -> PersistValue-pattern PersistLiteral bs <- PersistLiteral_ _ bs where-    PersistLiteral bs = PersistLiteral_ Unescaped bs+pattern PersistLiteral bs <- PersistLiteral_ _ bs+    where+        PersistLiteral bs = PersistLiteral_ Unescaped bs -{-# DEPRECATED PersistDbSpecific "Deprecated since 2.11 because of inconsistent escaping behavior across backends. The Postgres backend escapes these values, while the MySQL backend does not. If you are using this, please switch to 'PersistLiteral_' and provide a relevant 'LiteralType' for your conversion." #-}+{-# DEPRECATED+    PersistDbSpecific+    "Deprecated since 2.11 because of inconsistent escaping behavior across backends. The Postgres backend escapes these values, while the MySQL backend does not. If you are using this, please switch to 'PersistLiteral_' and provide a relevant 'LiteralType' for your conversion."+    #-}  keyToText :: Key -> Text keyFromText :: Text -> Key@@ -169,22 +174,25 @@ instance ToHttpApiData PersistValue where     toUrlPiece val =         case fromPersistValueText val of-            Left  e -> error $ Text.unpack e+            Left e -> error $ Text.unpack e             Right y -> y  instance FromHttpApiData PersistValue where     parseUrlPiece input =-          PersistInt64 <$> parseUrlPiece input-      <!> PersistList  <$> readTextData input-      <!> PersistText  <$> return input+        PersistInt64+            <$> parseUrlPiece input+                <!> PersistList+            <$> readTextData input+                <!> PersistText+            <$> return input       where         infixl 3 <!>         Left _ <!> y = y-        x      <!> _ = x+        x <!> _ = x  instance PathPiece PersistValue where-  toPathPiece   = toUrlPiece-  fromPathPiece = parseUrlPieceMaybe+    toPathPiece = toUrlPiece+    fromPathPiece = parseUrlPieceMaybe  fromPersistValueText :: PersistValue -> Either Text Text fromPersistValueText (PersistText s) = Right s@@ -217,9 +225,11 @@     toJSON PersistNull = A.Null     toJSON (PersistList l) = A.Array $ V.fromList $ map A.toJSON l     toJSON (PersistMap m) = A.object $ map go m-        where go (k, v) = (keyFromText k, A.toJSON v)+      where+        go (k, v) = (keyFromText k, A.toJSON v)     toJSON (PersistLiteral_ litTy b) =-        let encoded = TE.decodeUtf8 $ B64.encode b+        let+            encoded = TE.decodeUtf8 $ B64.encode b             prefix =                 case litTy of                     DbSpecific -> 'p'@@ -229,63 +239,80 @@             A.String $ Text.cons prefix encoded     toJSON (PersistArray a) = A.Array $ V.fromList $ map A.toJSON a     toJSON (PersistObjectId o) =-      A.toJSON $ showChar 'o' $ showHexLen 8 (bs2i four) $ showHexLen 16 (bs2i eight) ""-        where-         (four, eight) = BS8.splitAt 4 o+        A.toJSON $+            showChar 'o' $+                showHexLen 8 (bs2i four) $+                    showHexLen 16 (bs2i eight) ""+      where+        (four, eight) = BS8.splitAt 4 o -         -- taken from crypto-api-         bs2i :: ByteString -> Integer-         bs2i bs = BS.foldl' (\i b -> (i `shiftL` 8) + fromIntegral b) 0 bs-         {-# INLINE bs2i #-}+        -- taken from crypto-api+        bs2i :: ByteString -> Integer+        bs2i bs = BS.foldl' (\i b -> (i `shiftL` 8) + fromIntegral b) 0 bs+        {-# INLINE bs2i #-} -         -- showHex of n padded with leading zeros if necessary to fill d digits-         -- taken from Data.BSON-         showHexLen :: (Show n, Integral n) => Int -> n -> ShowS-         showHexLen d n = showString (replicate (d - sigDigits n) '0') . showHex n  where-             sigDigits 0 = 1-             sigDigits n' = truncate (logBase (16 :: Double) $ fromIntegral n') + 1+        -- showHex of n padded with leading zeros if necessary to fill d digits+        -- taken from Data.BSON+        showHexLen :: (Show n, Integral n) => Int -> n -> ShowS+        showHexLen d n = showString (replicate (d - sigDigits n) '0') . showHex n+          where+            sigDigits 0 = 1+            sigDigits n' = truncate (logBase (16 :: Double) $ fromIntegral n') + 1  instance A.FromJSON PersistValue where     parseJSON (A.String t0) =         case Text.uncons t0 of             Nothing -> fail "Null string"-            Just ('p', t) -> either (\_ -> fail "Invalid base64") (return . PersistDbSpecific)-                           $ B64.decode $ TE.encodeUtf8 t-            Just ('l', t) -> either (\_ -> fail "Invalid base64") (return . PersistLiteral)-                           $ B64.decode $ TE.encodeUtf8 t-            Just ('e', t) -> either (\_ -> fail "Invalid base64") (return . PersistLiteralEscaped)-                           $ B64.decode $ TE.encodeUtf8 t+            Just ('p', t) ->+                either (\_ -> fail "Invalid base64") (return . PersistDbSpecific) $+                    B64.decode $+                        TE.encodeUtf8 t+            Just ('l', t) ->+                either (\_ -> fail "Invalid base64") (return . PersistLiteral) $+                    B64.decode $+                        TE.encodeUtf8 t+            Just ('e', t) ->+                either (\_ -> fail "Invalid base64") (return . PersistLiteralEscaped) $+                    B64.decode $+                        TE.encodeUtf8 t             Just ('s', t) -> return $ PersistText t-            Just ('b', t) -> either (\_ -> fail "Invalid base64") (return . PersistByteString)-                           $ B64.decode $ TE.encodeUtf8 t+            Just ('b', t) ->+                either (\_ -> fail "Invalid base64") (return . PersistByteString) $+                    B64.decode $+                        TE.encodeUtf8 t             Just ('t', t) -> PersistTimeOfDay <$> readMay t             Just ('u', t) -> PersistUTCTime <$> readMay t             Just ('d', t) -> PersistDay <$> readMay t             Just ('r', t) -> PersistRational <$> readMay t-            Just ('o', t) -> maybe-                (fail "Invalid base64")-                (return . PersistObjectId . i2bs (8 * 12) . fst)-                $ headMay $ readHex $ Text.unpack t+            Just ('o', t) ->+                maybe+                    (fail "Invalid base64")+                    (return . PersistObjectId . i2bs (8 * 12) . fst)+                    $ headMay+                    $ readHex+                    $ Text.unpack t             Just (c, _) -> fail $ "Unknown prefix: " ++ [c]       where-        headMay []    = Nothing-        headMay (x:_) = Just x+        headMay [] = Nothing+        headMay (x : _) = Just x         readMay t =             case reads $ Text.unpack t of-                (x, _):_ -> return x+                (x, _) : _ -> return x                 [] -> fail "Could not read"          -- taken from crypto-api-        -- |@i2bs bitLen i@ converts @i@ to a 'ByteString' of @bitLen@ bits (must be a multiple of 8).+        -- \|@i2bs bitLen i@ converts @i@ to a 'ByteString' of @bitLen@ bits (must be a multiple of 8).         i2bs :: Int -> Integer -> ByteString-        i2bs l i = BS.unfoldr (\l' -> if l' < 0 then Nothing else Just (fromIntegral (i `shiftR` l'), l' - 8)) (l-8)+        i2bs l i =+            BS.unfoldr+                (\l' -> if l' < 0 then Nothing else Just (fromIntegral (i `shiftR` l'), l' - 8))+                (l - 8)         {-# INLINE i2bs #-}---    parseJSON (A.Number n) = return $-        if fromInteger (floor n) == n-            then PersistInt64 $ floor n-            else PersistDouble $ fromRational $ toRational n+    parseJSON (A.Number n) =+        return $+            if fromInteger (floor n) == n+                then PersistInt64 $ floor n+                else PersistDouble $ fromRational $ toRational n     parseJSON (A.Bool b) = return $ PersistBool b     parseJSON A.Null = return PersistNull     parseJSON (A.Array a) = fmap PersistList (mapM A.parseJSON $ V.toList a)@@ -293,4 +320,3 @@         fmap PersistMap $ mapM go $ AM.toList o       where         go (k, v) = (,) (keyToText k) <$> A.parseJSON v-
Database/Persist/Sql.hs view
@@ -8,44 +8,53 @@ -- -- Then, you'll use the operations module Database.Persist.Sql-    (-    -- * 'RawSql' and 'PersistFieldSql'+    ( -- * 'RawSql' and 'PersistFieldSql'       module Database.Persist.Sql.Class-    -- * Running actions-    -- | Run actions in a transaction with 'runSqlPool'.++      -- * Running actions++      -- | Run actions in a transaction with 'runSqlPool'.     , module Database.Persist.Sql.Run-    -- * Migrations++      -- * Migrations     , module Database.Persist.Sql.Migration-    -- * @persistent@ combinators-    -- | We re-export "Database.Persist" here, to make it easier to use query-    -- and update combinators. Check out that module for documentation.++      -- * @persistent@ combinators++      -- | We re-export "Database.Persist" here, to make it easier to use query+      -- and update combinators. Check out that module for documentation.     , module Database.Persist     , module Database.Persist.Sql.Orphan.PersistStore-    -- * The Escape Hatch-    -- | @persistent@ offers a set of functions that are useful for operating-    -- directly on the underlying SQL database. This can allow you to use-    -- whatever SQL features you want.-    ---    -- Consider going to <https://hackage.haskell.org/package/esqueleto-    -- esqueleto> for a more powerful SQL query library built on @persistent@.++      -- * The Escape Hatch++      -- | @persistent@ offers a set of functions that are useful for operating+      -- directly on the underlying SQL database. This can allow you to use+      -- whatever SQL features you want.+      --+      -- Consider going to <https://hackage.haskell.org/package/esqueleto+      -- esqueleto> for a more powerful SQL query library built on @persistent@.     , rawQuery     , rawQueryRes     , rawExecute     , rawExecuteCount     , rawSql-    -- * SQL helpers++      -- * SQL helpers     , deleteWhereCount     , updateWhereCount     , filterClause     , filterClauseWithVals     , orderClause     , FilterTablePrefix (..)-    -- * Transactions++      -- * Transactions     , transactionSave     , transactionSaveWithIsolation     , transactionUndo     , transactionUndoWithIsolation-    -- * Other utilities++      -- * Other utilities     , getStmtConn     , mkColumns     , BackendSpecificOverrides@@ -53,8 +62,9 @@     , getBackendSpecificForeignKeyName     , setBackendSpecificForeignKeyName     , defaultAttribute+       -- * Internal-    , IsolationLevel(..)+    , IsolationLevel (..)     , decorateSQLWithLimitOffset     , module Database.Persist.Sql.Types     ) where@@ -69,7 +79,10 @@ import Database.Persist.Sql.Raw import Database.Persist.Sql.Run hiding (rawAcquireSqlConn, rawRunSqlPool) import Database.Persist.Sql.Types-import Database.Persist.Sql.Types.Internal (IsolationLevel(..), SqlBackend(..))+import Database.Persist.Sql.Types.Internal+    ( IsolationLevel (..)+    , SqlBackend (..)+    )  import Database.Persist.Sql.Orphan.PersistQuery import Database.Persist.Sql.Orphan.PersistStore@@ -80,19 +93,22 @@ -- (which brackets its provided action with a transaction begin/commit pair). -- -- @since 1.2.0-transactionSave :: MonadIO m => ReaderT SqlBackend m ()+transactionSave :: (MonadIO m) => ReaderT SqlBackend m () transactionSave = do     conn <- ask-    let getter = getStmtConn conn+    let+        getter = getStmtConn conn     liftIO $ connCommit conn getter >> connBegin conn getter Nothing  -- | Commit the current transaction and begin a new one with the specified isolation level. -- -- @since 2.9.0-transactionSaveWithIsolation :: MonadIO m => IsolationLevel -> ReaderT SqlBackend m ()+transactionSaveWithIsolation+    :: (MonadIO m) => IsolationLevel -> ReaderT SqlBackend m () transactionSaveWithIsolation isolation = do     conn <- ask-    let getter = getStmtConn conn+    let+        getter = getStmtConn conn     liftIO $ connCommit conn getter >> connBegin conn getter (Just isolation)  -- | Roll back the current transaction and begin a new one.@@ -100,17 +116,20 @@ -- 'runSqlConn' call. -- -- @since 1.2.0-transactionUndo :: MonadIO m => ReaderT SqlBackend m ()+transactionUndo :: (MonadIO m) => ReaderT SqlBackend m () transactionUndo = do     conn <- ask-    let getter = getStmtConn conn+    let+        getter = getStmtConn conn     liftIO $ connRollback conn getter >> connBegin conn getter Nothing  -- | Roll back the current transaction and begin a new one with the specified isolation level. -- -- @since 2.9.0-transactionUndoWithIsolation :: MonadIO m => IsolationLevel -> ReaderT SqlBackend m ()+transactionUndoWithIsolation+    :: (MonadIO m) => IsolationLevel -> ReaderT SqlBackend m () transactionUndoWithIsolation isolation = do     conn <- ask-    let getter = getStmtConn conn+    let+        getter = getStmtConn conn     liftIO $ connRollback conn getter >> connBegin conn getter (Just isolation)
Database/Persist/Sql/Class.hs view
@@ -10,1271 +10,15257 @@ module Database.Persist.Sql.Class     ( RawSql (..)     , PersistFieldSql (..)-    , EntityWithPrefix(..)-    , unPrefix-    ) where--import Data.Bits (bitSizeMaybe)-import Data.ByteString (ByteString)-import Data.Fixed-import Data.Foldable (toList)-import Data.Int-import qualified Data.IntMap as IM-import qualified Data.Map as M-import Data.Maybe (fromMaybe)-import Data.Proxy (Proxy(..))-import qualified Data.Set as S-import Data.Text (Text, intercalate, pack)-import qualified Data.Text as T-import qualified Data.Text.Lazy as TL-import Data.Time (Day, TimeOfDay, UTCTime)-import qualified Data.Vector as V-import Data.Word-import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)-import Text.Blaze.Html (Html)--import Database.Persist-import Database.Persist.Sql.Types----- | Class for data types that may be retrived from a 'rawSql'--- query.-class RawSql a where-    -- | Number of columns that this data type needs and the list-    -- of substitutions for @SELECT@ placeholders @??@.-    rawSqlCols :: (Text -> Text) -> a -> (Int, [Text])--    -- | A string telling the user why the column count is what-    -- it is.-    rawSqlColCountReason :: a -> String--    -- | Transform a row of the result into the data type.-    rawSqlProcessRow :: [PersistValue] -> Either Text a--instance PersistField a => RawSql (Single a) where-    rawSqlCols _ _         = (1, [])-    rawSqlColCountReason _ = "one column for a 'Single' data type"-    rawSqlProcessRow [pv]  = Single <$> fromPersistValue pv-    rawSqlProcessRow _     = Left $ pack "RawSql (Single a): wrong number of columns."--instance-    (PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend) =>-    RawSql (Key a) where-    rawSqlCols _ key         = (length $ keyToValues key, [])-    rawSqlColCountReason key = "The primary key is composed of "-                               ++ (show $ length $ keyToValues key)-                               ++ " columns"-    rawSqlProcessRow         = keyFromValues--instance-    (PersistEntity record, PersistEntityBackend record ~ backend, IsPersistBackend backend)-  =>-    RawSql (Entity record)-  where-    rawSqlCols escape _ent = (length sqlFields, [intercalate ", " $ toList sqlFields])-      where-        sqlFields =-            fmap (((name <> ".") <>) . escapeWith escape)-            $ fmap fieldDB-            $ keyAndEntityFields entDef-        name =-            escapeWith escape (getEntityDBName entDef)-        entDef =-            entityDef (Nothing :: Maybe record)-    rawSqlColCountReason a =-        case fst (rawSqlCols (error "RawSql") a) of-          1 -> "one column for an 'Entity' data type without fields"-          n -> show n <> " columns for an 'Entity' data type"-    rawSqlProcessRow row =-        case keyFromRecordM of-            Just mkKey -> do-                val <- fromPersistValues row-                pure Entity-                    { entityKey =-                        mkKey val-                    , entityVal =-                        val-                    }-            Nothing ->-                case row of-                    (k : rest) ->-                        Entity-                            <$> keyFromValues [k]-                            <*> fromPersistValues rest-                    [] ->-                        Left "Row was empty"---- | This newtype wrapper is useful when selecting an entity out of the--- database and you want to provide a prefix to the table being selected.------ Consider this raw SQL query:------ > SELECT ??--- > FROM my_long_table_name AS mltn--- > INNER JOIN other_table AS ot--- >    ON mltn.some_col = ot.other_col--- > WHERE ...------ We don't want to refer to @my_long_table_name@ every time, so we create--- an alias. If we want to select it, we have to tell the raw SQL--- quasi-quoter that we expect the entity to be prefixed with some other--- name.------ We can give the above query a type with this, like:------ @--- getStuff :: 'SqlPersistM' ['EntityWithPrefix' \"mltn\" MyLongTableName]--- getStuff = rawSql queryText []--- @------ The 'EntityWithPrefix' bit is a boilerplate newtype wrapper, so you can--- remove it with 'unPrefix', like this:------ @--- getStuff :: 'SqlPersistM' ['Entity' MyLongTableName]--- getStuff = 'unPrefix' @\"mltn\" '<$>' 'rawSql' queryText []--- @------ The @ symbol is a "type application" and requires the @TypeApplications@--- language extension.------ @since 2.10.5-newtype EntityWithPrefix (prefix :: Symbol) record-    = EntityWithPrefix { unEntityWithPrefix :: Entity record }---- | A helper function to tell GHC what the 'EntityWithPrefix' prefix--- should be. This allows you to use a type application to specify the--- prefix, instead of specifying the etype on the result.------ As an example, here's code that uses this:------ @--- myQuery :: 'SqlPersistM' ['Entity' Person]--- myQuery = fmap (unPrefix @\"p\") <$> rawSql query []---   where---     query = "SELECT ?? FROM person AS p"--- @------ @since 2.10.5-unPrefix :: forall prefix record. EntityWithPrefix prefix record -> Entity record-unPrefix = unEntityWithPrefix--instance-    ( PersistEntity record-    , KnownSymbol prefix-    , PersistEntityBackend record ~ backend-    , IsPersistBackend backend-    )-  =>-    RawSql (EntityWithPrefix prefix record)-  where-    rawSqlCols escape _ent = (length sqlFields, [intercalate ", " $ toList sqlFields])-      where-          sqlFields =-              fmap (((name <> ".") <>) . escapeWith escape)-              $ fmap fieldDB-              -- Hacky for a composite key because-              -- it selects the same field multiple times-              $ keyAndEntityFields entDef-          name =-              pack $ symbolVal (Proxy :: Proxy prefix)-          entDef =-              entityDef (Nothing :: Maybe record)-    rawSqlColCountReason a =-        case fst (rawSqlCols (error "RawSql") a) of-            1 -> "one column for an 'Entity' data type without fields"-            n -> show n ++ " columns for an 'Entity' data type"-    rawSqlProcessRow row =-        case splitAt nKeyFields row of-            (rowKey, rowVal) ->-                fmap EntityWithPrefix $-                    Entity-                        <$> keyFromValues rowKey-                        <*> fromPersistValues rowVal-      where-        nKeyFields = length $ getEntityKeyFields entDef-        entDef = entityDef (Nothing :: Maybe record)---- | @since 1.0.1-instance RawSql a => RawSql (Maybe a) where-    rawSqlCols e = rawSqlCols e . extractMaybe-    rawSqlColCountReason = rawSqlColCountReason . extractMaybe-    rawSqlProcessRow cols-      | all isNull cols = return Nothing-      | otherwise       =-        case rawSqlProcessRow cols of-          Right v  -> Right (Just v)-          Left msg -> Left $ "RawSql (Maybe a): not all columns were Null " <>-                             "but the inner parser has failed.  Its message " <>-                             "was \"" <> msg <> "\".  Did you apply Maybe " <>-                             "to a tuple, perhaps?  The main use case for " <>-                             "Maybe is to allow OUTER JOINs to be written, " <>-                             "in which case 'Maybe (Entity v)' is used."-      where isNull PersistNull = True-            isNull _           = False--instance (RawSql a, RawSql b) => RawSql (a, b) where-    rawSqlCols e x = rawSqlCols e (fst x) # rawSqlCols e (snd x)-        where (cnta, lsta) # (cntb, lstb) = (cnta + cntb, lsta ++ lstb)-    rawSqlColCountReason x = rawSqlColCountReason (fst x) ++ ", " ++-                             rawSqlColCountReason (snd x)-    rawSqlProcessRow =-        let x = getType processRow-            getType :: (z -> Either y x) -> x-            getType = error "RawSql.getType"--            colCountFst = fst $ rawSqlCols (error "RawSql.getType2") (fst x)-            processRow row =-                let (rowFst, rowSnd) = splitAt colCountFst row-                in (,) <$> rawSqlProcessRow rowFst-                       <*> rawSqlProcessRow rowSnd--        in colCountFst `seq` processRow-           -- Avoids recalculating 'colCountFst'.--instance (RawSql a, RawSql b, RawSql c) => RawSql (a, b, c) where-    rawSqlCols e         = rawSqlCols e         . from3-    rawSqlColCountReason = rawSqlColCountReason . from3-    rawSqlProcessRow     = fmap to3 . rawSqlProcessRow--from3 :: (a,b,c) -> ((a,b),c)-from3 (a,b,c) = ((a,b),c)--to3 :: ((a,b),c) -> (a,b,c)-to3 ((a,b),c) = (a,b,c)--instance (RawSql a, RawSql b, RawSql c, RawSql d) => RawSql (a, b, c, d) where-    rawSqlCols e         = rawSqlCols e         . from4-    rawSqlColCountReason = rawSqlColCountReason . from4-    rawSqlProcessRow     = fmap to4 . rawSqlProcessRow--from4 :: (a,b,c,d) -> ((a,b),(c,d))-from4 (a,b,c,d) = ((a,b),(c,d))--to4 :: ((a,b),(c,d)) -> (a,b,c,d)-to4 ((a,b),(c,d)) = (a,b,c,d)--instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e)-       => RawSql (a, b, c, d, e) where-    rawSqlCols e         = rawSqlCols e         . from5-    rawSqlColCountReason = rawSqlColCountReason . from5-    rawSqlProcessRow     = fmap to5 . rawSqlProcessRow--from5 :: (a,b,c,d,e) -> ((a,b),(c,d),e)-from5 (a,b,c,d,e) = ((a,b),(c,d),e)--to5 :: ((a,b),(c,d),e) -> (a,b,c,d,e)-to5 ((a,b),(c,d),e) = (a,b,c,d,e)--instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f)-       => RawSql (a, b, c, d, e, f) where-    rawSqlCols e         = rawSqlCols e         . from6-    rawSqlColCountReason = rawSqlColCountReason . from6-    rawSqlProcessRow     = fmap to6 . rawSqlProcessRow--from6 :: (a,b,c,d,e,f) -> ((a,b),(c,d),(e,f))-from6 (a,b,c,d,e,f) = ((a,b),(c,d),(e,f))--to6 :: ((a,b),(c,d),(e,f)) -> (a,b,c,d,e,f)-to6 ((a,b),(c,d),(e,f)) = (a,b,c,d,e,f)--instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g)-       => RawSql (a, b, c, d, e, f, g) where-    rawSqlCols e         = rawSqlCols e         . from7-    rawSqlColCountReason = rawSqlColCountReason . from7-    rawSqlProcessRow     = fmap to7 . rawSqlProcessRow--from7 :: (a,b,c,d,e,f,g) -> ((a,b),(c,d),(e,f),g)-from7 (a,b,c,d,e,f,g) = ((a,b),(c,d),(e,f),g)--to7 :: ((a,b),(c,d),(e,f),g) -> (a,b,c,d,e,f,g)-to7 ((a,b),(c,d),(e,f),g) = (a,b,c,d,e,f,g)--instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g, RawSql h)-       => RawSql (a, b, c, d, e, f, g, h) where-    rawSqlCols e         = rawSqlCols e         . from8-    rawSqlColCountReason = rawSqlColCountReason . from8-    rawSqlProcessRow     = fmap to8 . rawSqlProcessRow--from8 :: (a,b,c,d,e,f,g,h) -> ((a,b),(c,d),(e,f),(g,h))-from8 (a,b,c,d,e,f,g,h) = ((a,b),(c,d),(e,f),(g,h))--to8 :: ((a,b),(c,d),(e,f),(g,h)) -> (a,b,c,d,e,f,g,h)-to8 ((a,b),(c,d),(e,f),(g,h)) = (a,b,c,d,e,f,g,h)---- | @since 2.10.2-instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g, RawSql h, RawSql i)-       => RawSql (a, b, c, d, e, f, g, h, i) where-    rawSqlCols e         = rawSqlCols e         . from9-    rawSqlColCountReason = rawSqlColCountReason . from9-    rawSqlProcessRow     = fmap to9 . rawSqlProcessRow---- | @since 2.10.2-from9 :: (a,b,c,d,e,f,g,h,i) -> ((a,b),(c,d),(e,f),(g,h),i)-from9 (a,b,c,d,e,f,g,h,i) = ((a,b),(c,d),(e,f),(g,h),i)---- | @since 2.10.2-to9 :: ((a,b),(c,d),(e,f),(g,h),i) -> (a,b,c,d,e,f,g,h,i)-to9 ((a,b),(c,d),(e,f),(g,h),i) = (a,b,c,d,e,f,g,h,i)---- | @since 2.10.2-instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g, RawSql h, RawSql i,-          RawSql j)-       => RawSql (a, b, c, d, e, f, g, h, i, j) where-    rawSqlCols e         = rawSqlCols e         . from10-    rawSqlColCountReason = rawSqlColCountReason . from10-    rawSqlProcessRow     = fmap to10 . rawSqlProcessRow---- | @since 2.10.2-from10 :: (a,b,c,d,e,f,g,h,i,j) -> ((a,b),(c,d),(e,f),(g,h),(i,j))-from10 (a,b,c,d,e,f,g,h,i,j) = ((a,b),(c,d),(e,f),(g,h),(i,j))---- | @since 2.10.2-to10 :: ((a,b),(c,d),(e,f),(g,h),(i,j)) -> (a,b,c,d,e,f,g,h,i,j)-to10 ((a,b),(c,d),(e,f),(g,h),(i,j)) = (a,b,c,d,e,f,g,h,i,j)---- | @since 2.10.2-instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g, RawSql h, RawSql i,-          RawSql j, RawSql k)-       => RawSql (a, b, c, d, e, f, g, h, i, j, k) where-    rawSqlCols e         = rawSqlCols e         . from11-    rawSqlColCountReason = rawSqlColCountReason . from11-    rawSqlProcessRow     = fmap to11 . rawSqlProcessRow---- | @since 2.10.2-from11 :: (a,b,c,d,e,f,g,h,i,j,k) -> ((a,b),(c,d),(e,f),(g,h),(i,j),k)-from11 (a,b,c,d,e,f,g,h,i,j,k) = ((a,b),(c,d),(e,f),(g,h),(i,j),k)---- | @since 2.10.2-to11 :: ((a,b),(c,d),(e,f),(g,h),(i,j),k) -> (a,b,c,d,e,f,g,h,i,j,k)-to11 ((a,b),(c,d),(e,f),(g,h),(i,j),k) = (a,b,c,d,e,f,g,h,i,j,k)---- | @since 2.10.2-instance (RawSql a, RawSql b, RawSql c,-          RawSql d, RawSql e, RawSql f,-          RawSql g, RawSql h, RawSql i,-          RawSql j, RawSql k, RawSql l)-       => RawSql (a, b, c, d, e, f, g, h, i, j, k, l) where-    rawSqlCols e         = rawSqlCols e         . from12-    rawSqlColCountReason = rawSqlColCountReason . from12-    rawSqlProcessRow     = fmap to12 . rawSqlProcessRow---- | @since 2.10.2-from12 :: (a,b,c,d,e,f,g,h,i,j,k,l) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l))-from12 (a,b,c,d,e,f,g,h,i,j,k,l) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l))---- | @since 2.10.2-to12 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l)) -> (a,b,c,d,e,f,g,h,i,j,k,l)-to12 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l)) = (a,b,c,d,e,f,g,h,i,j,k,l)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m) where-    rawSqlCols e         = rawSqlCols e         . from13-    rawSqlColCountReason = rawSqlColCountReason . from13-    rawSqlProcessRow     = fmap to13 . rawSqlProcessRow---- | @since 2.11.0-from13 :: (a,b,c,d,e,f,g,h,i,j,k,l,m) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),m)-from13 (a,b,c,d,e,f,g,h,i,j,k,l,m) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),m)---- | @since 2.11.0-to13 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),m) -> (a,b,c,d,e,f,g,h,i,j,k,l,m)-to13 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),m) = (a,b,c,d,e,f,g,h,i,j,k,l,m)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n) where-    rawSqlCols e         = rawSqlCols e         . from14-    rawSqlColCountReason = rawSqlColCountReason . from14-    rawSqlProcessRow     = fmap to14 . rawSqlProcessRow---- | @since 2.11.0-from14 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n))-from14 (a,b,c,d,e,f,g,h,i,j,k,l,m,n) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n))---- | @since 2.11.0-to14 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n)-to14 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) where-    rawSqlCols e         = rawSqlCols e         . from15-    rawSqlColCountReason = rawSqlColCountReason . from15-    rawSqlProcessRow     = fmap to15 . rawSqlProcessRow---- | @since 2.11.0-from15 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),o)-from15 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),o)---- | @since 2.11.0-to15 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),o) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)-to15 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),o) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) where-    rawSqlCols e         = rawSqlCols e         . from16-    rawSqlColCountReason = rawSqlColCountReason . from16-    rawSqlProcessRow     = fmap to16 . rawSqlProcessRow---- | @since 2.11.0-from16 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p))-from16 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p))---- | @since 2.11.0-to16 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)-to16 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) where-    rawSqlCols e         = rawSqlCols e         . from17-    rawSqlColCountReason = rawSqlColCountReason . from17-    rawSqlProcessRow     = fmap to17 . rawSqlProcessRow---- | @since 2.11.0-from17 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),q)-from17 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),q)---- | @since 2.11.0-to17 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),q) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)-to17 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),q) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) where-    rawSqlCols e         = rawSqlCols e         . from18-    rawSqlColCountReason = rawSqlColCountReason . from18-    rawSqlProcessRow     = fmap to18 . rawSqlProcessRow---- | @since 2.11.0-from18 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r))-from18 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r))---- | @since 2.11.0-to18 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)-to18 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) where-    rawSqlCols e         = rawSqlCols e         . from19-    rawSqlColCountReason = rawSqlColCountReason . from19-    rawSqlProcessRow     = fmap to19 . rawSqlProcessRow---- | @since 2.11.0-from19 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),s)-from19 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),s)---- | @since 2.11.0-to19 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),s) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s)-to19 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),s) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) where-    rawSqlCols e         = rawSqlCols e         . from20-    rawSqlColCountReason = rawSqlColCountReason . from20-    rawSqlProcessRow     = fmap to20 . rawSqlProcessRow---- | @since 2.11.0-from20 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t))-from20 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t))---- | @since 2.11.0-to20 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)-to20 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) where-    rawSqlCols e         = rawSqlCols e         . from21-    rawSqlColCountReason = rawSqlColCountReason . from21-    rawSqlProcessRow     = fmap to21 . rawSqlProcessRow---- | @since 2.11.0-from21 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),u)-from21 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),u)---- | @since 2.11.0-to21 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),u) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)-to21 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),u) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) where-    rawSqlCols e         = rawSqlCols e         . from22-    rawSqlColCountReason = rawSqlColCountReason . from22-    rawSqlProcessRow     = fmap to22 . rawSqlProcessRow---- | @since 2.11.0-from22 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v))-from22 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v))---- | @since 2.11.0-to22 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v)-to22 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) where-    rawSqlCols e         = rawSqlCols e         . from23-    rawSqlColCountReason = rawSqlColCountReason . from23-    rawSqlProcessRow     = fmap to23 . rawSqlProcessRow---- | @since 2.11.0-from23 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),w)-from23 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),w)---- | @since 2.11.0-to23 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),w) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w)-to23 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),w) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) where-    rawSqlCols e         = rawSqlCols e         . from24-    rawSqlColCountReason = rawSqlColCountReason . from24-    rawSqlProcessRow     = fmap to24 . rawSqlProcessRow---- | @since 2.11.0-from24 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x))-from24 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x))---- | @since 2.11.0-to24 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)-to24 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) where-    rawSqlCols e         = rawSqlCols e         . from25-    rawSqlColCountReason = rawSqlColCountReason . from25-    rawSqlProcessRow     = fmap to25 . rawSqlProcessRow---- | @since 2.11.0-from25 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),y)-from25 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),y)---- | @since 2.11.0-to25 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),y) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)-to25 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),y) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) where-    rawSqlCols e         = rawSqlCols e         . from26-    rawSqlColCountReason = rawSqlColCountReason . from26-    rawSqlProcessRow     = fmap to26 . rawSqlProcessRow---- | @since 2.11.0-from26 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z))-from26 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z))---- | @since 2.11.0-to26 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)-to26 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2) where-    rawSqlCols e         = rawSqlCols e         . from27-    rawSqlColCountReason = rawSqlColCountReason . from27-    rawSqlProcessRow     = fmap to27 . rawSqlProcessRow---- | @since 2.11.0-from27 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),a2)-from27 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),a2)---- | @since 2.11.0-to27 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),a2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2)-to27 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),a2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2) where-    rawSqlCols e         = rawSqlCols e         . from28-    rawSqlColCountReason = rawSqlColCountReason . from28-    rawSqlProcessRow     = fmap to28 . rawSqlProcessRow---- | @since 2.11.0-from28 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2))-from28 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2))---- | @since 2.11.0-to28 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2)-to28 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2) where-    rawSqlCols e         = rawSqlCols e         . from29-    rawSqlColCountReason = rawSqlColCountReason . from29-    rawSqlProcessRow     = fmap to29 . rawSqlProcessRow---- | @since 2.11.0-from29 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),c2)-from29 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),c2)---- | @since 2.11.0-to29 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),c2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2)-to29 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),c2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2) where-    rawSqlCols e         = rawSqlCols e         . from30-    rawSqlColCountReason = rawSqlColCountReason . from30-    rawSqlProcessRow     = fmap to30 . rawSqlProcessRow---- | @since 2.11.0-from30 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2))-from30 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2))---- | @since 2.11.0-to30 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2)-to30 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2) where-    rawSqlCols e         = rawSqlCols e         . from31-    rawSqlColCountReason = rawSqlColCountReason . from31-    rawSqlProcessRow     = fmap to31 . rawSqlProcessRow---- | @since 2.11.0-from31 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),e2)-from31 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),e2)---- | @since 2.11.0-to31 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),e2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2)-to31 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),e2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2) where-    rawSqlCols e         = rawSqlCols e         . from32-    rawSqlColCountReason = rawSqlColCountReason . from32-    rawSqlProcessRow     = fmap to32 . rawSqlProcessRow---- | @since 2.11.0-from32 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2))-from32 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2))---- | @since 2.11.0-to32 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2)-to32 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2) where-    rawSqlCols e         = rawSqlCols e         . from33-    rawSqlColCountReason = rawSqlColCountReason . from33-    rawSqlProcessRow     = fmap to33 . rawSqlProcessRow---- | @since 2.11.0-from33 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),g2)-from33 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),g2)---- | @since 2.11.0-to33 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),g2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2)-to33 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),g2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2) where-    rawSqlCols e         = rawSqlCols e         . from34-    rawSqlColCountReason = rawSqlColCountReason . from34-    rawSqlProcessRow     = fmap to34 . rawSqlProcessRow---- | @since 2.11.0-from34 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2))-from34 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2))---- | @since 2.11.0-to34 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2)-to34 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2) where-    rawSqlCols e         = rawSqlCols e         . from35-    rawSqlColCountReason = rawSqlColCountReason . from35-    rawSqlProcessRow     = fmap to35 . rawSqlProcessRow---- | @since 2.11.0-from35 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),i2)-from35 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),i2)---- | @since 2.11.0-to35 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),i2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2)-to35 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),i2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2) where-    rawSqlCols e         = rawSqlCols e         . from36-    rawSqlColCountReason = rawSqlColCountReason . from36-    rawSqlProcessRow     = fmap to36 . rawSqlProcessRow---- | @since 2.11.0-from36 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2))-from36 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2))---- | @since 2.11.0-to36 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2)-to36 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2) where-    rawSqlCols e         = rawSqlCols e         . from37-    rawSqlColCountReason = rawSqlColCountReason . from37-    rawSqlProcessRow     = fmap to37 . rawSqlProcessRow---- | @since 2.11.0-from37 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),k2)-from37 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),k2)---- | @since 2.11.0-to37 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),k2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2)-to37 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),k2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2) where-    rawSqlCols e         = rawSqlCols e         . from38-    rawSqlColCountReason = rawSqlColCountReason . from38-    rawSqlProcessRow     = fmap to38 . rawSqlProcessRow---- | @since 2.11.0-from38 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2))-from38 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2))---- | @since 2.11.0-to38 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2)-to38 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2) where-    rawSqlCols e         = rawSqlCols e         . from39-    rawSqlColCountReason = rawSqlColCountReason . from39-    rawSqlProcessRow     = fmap to39 . rawSqlProcessRow---- | @since 2.11.0-from39 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),m2)-from39 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),m2)---- | @since 2.11.0-to39 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),m2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2)-to39 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),m2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2) where-    rawSqlCols e         = rawSqlCols e         . from40-    rawSqlColCountReason = rawSqlColCountReason . from40-    rawSqlProcessRow     = fmap to40 . rawSqlProcessRow---- | @since 2.11.0-from40 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2))-from40 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2))---- | @since 2.11.0-to40 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2)-to40 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2) where-    rawSqlCols e         = rawSqlCols e         . from41-    rawSqlColCountReason = rawSqlColCountReason . from41-    rawSqlProcessRow     = fmap to41 . rawSqlProcessRow---- | @since 2.11.0-from41 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),o2)-from41 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),o2)---- | @since 2.11.0-to41 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),o2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2)-to41 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),o2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2) where-    rawSqlCols e         = rawSqlCols e         . from42-    rawSqlColCountReason = rawSqlColCountReason . from42-    rawSqlProcessRow     = fmap to42 . rawSqlProcessRow---- | @since 2.11.0-from42 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2))-from42 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2))---- | @since 2.11.0-to42 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2)-to42 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2) where-    rawSqlCols e         = rawSqlCols e         . from43-    rawSqlColCountReason = rawSqlColCountReason . from43-    rawSqlProcessRow     = fmap to43 . rawSqlProcessRow---- | @since 2.11.0-from43 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),q2)-from43 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),q2)---- | @since 2.11.0-to43 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),q2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2)-to43 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),q2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2) where-    rawSqlCols e         = rawSqlCols e         . from44-    rawSqlColCountReason = rawSqlColCountReason . from44-    rawSqlProcessRow     = fmap to44 . rawSqlProcessRow---- | @since 2.11.0-from44 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2))-from44 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2))---- | @since 2.11.0-to44 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2)-to44 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2) where-    rawSqlCols e         = rawSqlCols e         . from45-    rawSqlColCountReason = rawSqlColCountReason . from45-    rawSqlProcessRow     = fmap to45 . rawSqlProcessRow---- | @since 2.11.0-from45 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),s2)-from45 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),s2)---- | @since 2.11.0-to45 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),s2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2)-to45 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),s2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2) where-    rawSqlCols e         = rawSqlCols e         . from46-    rawSqlColCountReason = rawSqlColCountReason . from46-    rawSqlProcessRow     = fmap to46 . rawSqlProcessRow---- | @since 2.11.0-from46 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2))-from46 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2))---- | @since 2.11.0-to46 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2)-to46 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2) where-    rawSqlCols e         = rawSqlCols e         . from47-    rawSqlColCountReason = rawSqlColCountReason . from47-    rawSqlProcessRow     = fmap to47 . rawSqlProcessRow---- | @since 2.11.0-from47 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),u2)-from47 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),u2)---- | @since 2.11.0-to47 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),u2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2)-to47 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),u2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2) where-    rawSqlCols e         = rawSqlCols e         . from48-    rawSqlColCountReason = rawSqlColCountReason . from48-    rawSqlProcessRow     = fmap to48 . rawSqlProcessRow---- | @since 2.11.0-from48 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2))-from48 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2))---- | @since 2.11.0-to48 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2)-to48 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2) where-    rawSqlCols e         = rawSqlCols e         . from49-    rawSqlColCountReason = rawSqlColCountReason . from49-    rawSqlProcessRow     = fmap to49 . rawSqlProcessRow---- | @since 2.11.0-from49 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),w2)-from49 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),w2)---- | @since 2.11.0-to49 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),w2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2)-to49 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),w2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2) where-    rawSqlCols e         = rawSqlCols e         . from50-    rawSqlColCountReason = rawSqlColCountReason . from50-    rawSqlProcessRow     = fmap to50 . rawSqlProcessRow---- | @since 2.11.0-from50 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2))-from50 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2))---- | @since 2.11.0-to50 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2)-to50 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2) where-    rawSqlCols e         = rawSqlCols e         . from51-    rawSqlColCountReason = rawSqlColCountReason . from51-    rawSqlProcessRow     = fmap to51 . rawSqlProcessRow---- | @since 2.11.0-from51 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),y2)-from51 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),y2)---- | @since 2.11.0-to51 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),y2) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2)-to51 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),y2) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2) where-    rawSqlCols e         = rawSqlCols e         . from52-    rawSqlColCountReason = rawSqlColCountReason . from52-    rawSqlProcessRow     = fmap to52 . rawSqlProcessRow---- | @since 2.11.0-from52 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2))-from52 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2))---- | @since 2.11.0-to52 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2)-to52 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3) where-    rawSqlCols e         = rawSqlCols e         . from53-    rawSqlColCountReason = rawSqlColCountReason . from53-    rawSqlProcessRow     = fmap to53 . rawSqlProcessRow---- | @since 2.11.0-from53 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3)-from53 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3)---- | @since 2.11.0-to53 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3)-to53 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),a3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3) where-    rawSqlCols e         = rawSqlCols e         . from54-    rawSqlColCountReason = rawSqlColCountReason . from54-    rawSqlProcessRow     = fmap to54 . rawSqlProcessRow---- | @since 2.11.0-from54 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3))-from54 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3))---- | @since 2.11.0-to54 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3)-to54 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3) where-    rawSqlCols e         = rawSqlCols e         . from55-    rawSqlColCountReason = rawSqlColCountReason . from55-    rawSqlProcessRow     = fmap to55 . rawSqlProcessRow---- | @since 2.11.0-from55 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),c3)-from55 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),c3)---- | @since 2.11.0-to55 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),c3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3)-to55 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),c3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3) where-    rawSqlCols e         = rawSqlCols e         . from56-    rawSqlColCountReason = rawSqlColCountReason . from56-    rawSqlProcessRow     = fmap to56 . rawSqlProcessRow---- | @since 2.11.0-from56 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3))-from56 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3))---- | @since 2.11.0-to56 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3)-to56 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3) where-    rawSqlCols e         = rawSqlCols e         . from57-    rawSqlColCountReason = rawSqlColCountReason . from57-    rawSqlProcessRow     = fmap to57 . rawSqlProcessRow---- | @since 2.11.0-from57 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),e3)-from57 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),e3)---- | @since 2.11.0-to57 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),e3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3)-to57 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),e3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3) where-    rawSqlCols e         = rawSqlCols e         . from58-    rawSqlColCountReason = rawSqlColCountReason . from58-    rawSqlProcessRow     = fmap to58 . rawSqlProcessRow---- | @since 2.11.0-from58 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3))-from58 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3))---- | @since 2.11.0-to58 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3)-to58 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3) where-    rawSqlCols e         = rawSqlCols e         . from59-    rawSqlColCountReason = rawSqlColCountReason . from59-    rawSqlProcessRow     = fmap to59 . rawSqlProcessRow---- | @since 2.11.0-from59 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),g3)-from59 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),g3)---- | @since 2.11.0-to59 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),g3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3)-to59 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),g3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3) where-    rawSqlCols e         = rawSqlCols e         . from60-    rawSqlColCountReason = rawSqlColCountReason . from60-    rawSqlProcessRow     = fmap to60 . rawSqlProcessRow---- | @since 2.11.0-from60 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3))-from60 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3))---- | @since 2.11.0-to60 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3)-to60 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3, RawSql i3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3) where-    rawSqlCols e         = rawSqlCols e         . from61-    rawSqlColCountReason = rawSqlColCountReason . from61-    rawSqlProcessRow     = fmap to61 . rawSqlProcessRow---- | @since 2.11.0-from61 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),i3)-from61 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),i3)---- | @since 2.11.0-to61 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),i3) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3)-to61 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),i3) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3)---- | @since 2.11.0-instance (RawSql a, RawSql b, RawSql c, RawSql d, RawSql e, RawSql f, RawSql g, RawSql h, RawSql i, RawSql j, RawSql k, RawSql l, RawSql m, RawSql n, RawSql o, RawSql p, RawSql q, RawSql r, RawSql s, RawSql t, RawSql u, RawSql v, RawSql w, RawSql x, RawSql y, RawSql z, RawSql a2, RawSql b2, RawSql c2, RawSql d2, RawSql e2, RawSql f2, RawSql g2, RawSql h2, RawSql i2, RawSql j2, RawSql k2, RawSql l2, RawSql m2, RawSql n2, RawSql o2, RawSql p2, RawSql q2, RawSql r2, RawSql s2, RawSql t2, RawSql u2, RawSql v2, RawSql w2, RawSql x2, RawSql y2, RawSql z2, RawSql a3, RawSql b3, RawSql c3, RawSql d3, RawSql e3, RawSql f3, RawSql g3, RawSql h3, RawSql i3, RawSql j3)-      => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a2, b2, c2, d2, e2, f2, g2, h2, i2, j2, k2, l2, m2, n2, o2, p2, q2, r2, s2, t2, u2, v2, w2, x2, y2, z2, a3, b3, c3, d3, e3, f3, g3, h3, i3, j3) where-    rawSqlCols e         = rawSqlCols e         . from62-    rawSqlColCountReason = rawSqlColCountReason . from62-    rawSqlProcessRow     = fmap to62 . rawSqlProcessRow---- | @since 2.11.0-from62 :: (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3,j3) -> ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),(i3,j3))-from62 (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3,j3) = ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),(i3,j3))---- | @since 2.11.0-to62 :: ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),(i3,j3)) -> (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3,j3)-to62 ((a,b),(c,d),(e,f),(g,h),(i,j),(k,l),(m,n),(o,p),(q,r),(s,t),(u,v),(w,x),(y,z),(a2,b2),(c2,d2),(e2,f2),(g2,h2),(i2,j2),(k2,l2),(m2,n2),(o2,p2),(q2,r2),(s2,t2),(u2,v2),(w2,x2),(y2,z2),(a3,b3),(c3,d3),(e3,f3),(g3,h3),(i3,j3)) = (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2,m2,n2,o2,p2,q2,r2,s2,t2,u2,v2,w2,x2,y2,z2,a3,b3,c3,d3,e3,f3,g3,h3,i3,j3)--extractMaybe :: Maybe a -> a-extractMaybe = fromMaybe (error "Database.Persist.GenericSql.extractMaybe")---- | Tells Persistent what database column type should be used to store a Haskell type.------ ==== __Examples__------ ===== Simple Boolean Alternative------ @--- data Switch = On | Off---   deriving (Show, Eq)------ instance 'PersistField' Switch where---   'toPersistValue' s = case s of---     On -> 'PersistBool' True---     Off -> 'PersistBool' False---   'fromPersistValue' ('PersistBool' b) = if b then 'Right' On else 'Right' Off---   'fromPersistValue' x = Left $ "File.hs: When trying to deserialize a Switch: expected PersistBool, received: " <> T.pack (show x)------ instance 'PersistFieldSql' Switch where---   'sqlType' _ = 'SqlBool'--- @------ ===== Non-Standard Database Types------ If your database supports non-standard types, such as Postgres' @uuid@, you can use 'SqlOther' to use them:------ @--- import qualified Data.UUID as UUID--- instance 'PersistField' UUID where---   'toPersistValue' = 'PersistLiteralEncoded' . toASCIIBytes---   'fromPersistValue' ('PersistLiteralEncoded' uuid) =---     case fromASCIIBytes uuid of---       'Nothing' -> 'Left' $ "Model/CustomTypes.hs: Failed to deserialize a UUID; received: " <> T.pack (show uuid)---       'Just' uuid' -> 'Right' uuid'---   'fromPersistValue' x = Left $ "File.hs: When trying to deserialize a UUID: expected PersistLiteralEncoded, received: "-- >  <> T.pack (show x)------ instance 'PersistFieldSql' UUID where---   'sqlType' _ = 'SqlOther' "uuid"--- @------ ===== User Created Database Types------ Similarly, some databases support creating custom types, e.g. Postgres' <https://www.postgresql.org/docs/current/static/sql-createdomain.html DOMAIN> and <https://www.postgresql.org/docs/current/static/datatype-enum.html ENUM> features. You can use 'SqlOther' to specify a custom type:------ > CREATE DOMAIN ssn AS text--- >       CHECK ( value ~ '^[0-9]{9}$');------ @--- instance 'PersistFieldSQL' SSN where---   'sqlType' _ = 'SqlOther' "ssn"--- @------ > CREATE TYPE rainbow_color AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet');------ @--- instance 'PersistFieldSQL' RainbowColor where---   'sqlType' _ = 'SqlOther' "rainbow_color"--- @-class PersistField a => PersistFieldSql a where-    sqlType :: Proxy a -> SqlType--#ifndef NO_OVERLAP-instance {-# OVERLAPPING #-} PersistFieldSql [Char] where-    sqlType _ = SqlString-#endif--instance PersistFieldSql ByteString where-    sqlType _ = SqlBlob-instance PersistFieldSql T.Text where-    sqlType _ = SqlString-instance PersistFieldSql TL.Text where-    sqlType _ = SqlString-instance PersistFieldSql Html where-    sqlType _ = SqlString-instance PersistFieldSql Int where-    sqlType _-        | Just x <- bitSizeMaybe (0 :: Int), x <= 32 = SqlInt32-        | otherwise = SqlInt64-instance PersistFieldSql Int8 where-    sqlType _ = SqlInt32-instance PersistFieldSql Int16 where-    sqlType _ = SqlInt32-instance PersistFieldSql Int32 where-    sqlType _ = SqlInt32-instance PersistFieldSql Int64 where-    sqlType _ = SqlInt64-instance PersistFieldSql Word where-    sqlType _ = SqlInt64-instance PersistFieldSql Word8 where-    sqlType _ = SqlInt32-instance PersistFieldSql Word16 where-    sqlType _ = SqlInt32-instance PersistFieldSql Word32 where-    sqlType _ = SqlInt64-instance PersistFieldSql Word64 where-    sqlType _ = SqlInt64-instance PersistFieldSql Double where-    sqlType _ = SqlReal-instance PersistFieldSql Bool where-    sqlType _ = SqlBool-instance PersistFieldSql Day where-    sqlType _ = SqlDay-instance PersistFieldSql TimeOfDay where-    sqlType _ = SqlTime-instance PersistFieldSql UTCTime where-    sqlType _ = SqlDayTime-instance PersistFieldSql a => PersistFieldSql (Maybe a) where-    sqlType _ = sqlType (Proxy :: Proxy a)-instance {-# OVERLAPPABLE #-} PersistFieldSql a => PersistFieldSql [a] where-    sqlType _ = SqlString-instance PersistFieldSql a => PersistFieldSql (V.Vector a) where-  sqlType _ = SqlString-instance (Ord a, PersistFieldSql a) => PersistFieldSql (S.Set a) where-    sqlType _ = SqlString-instance (PersistFieldSql a, PersistFieldSql b) => PersistFieldSql (a,b) where-    sqlType _ = SqlString-instance PersistFieldSql v => PersistFieldSql (IM.IntMap v) where-    sqlType _ = SqlString-instance PersistFieldSql v => PersistFieldSql (M.Map T.Text v) where-    sqlType _ = SqlString-instance PersistFieldSql PersistValue where-    sqlType _ = SqlInt64 -- since PersistValue should only be used like this for keys, which in SQL are Int64-instance PersistFieldSql Checkmark where-    sqlType    _ = SqlBool-instance (HasResolution a) => PersistFieldSql (Fixed a) where-    sqlType a =-        SqlNumeric long prec-      where-        prec = round $ (log $ fromIntegral $ resolution n) / (log 10 :: Double) --  FIXME: May lead to problems with big numbers-        long = prec + 10                                                        --  FIXME: Is this enough ?-        n = 0-        _mn = return n `asTypeOf` a--instance PersistFieldSql Rational where-    sqlType _ = SqlNumeric 32 20   --  need to make this field big enough to handle Rational to Mumber string conversion for ODBC----- | This type uses the 'SqlInt64' version, which will exhibit overflow and--- underflow behavior. Additionally, it permits negative values in the--- database, which isn't ideal.------ @since 2.11.0-instance PersistFieldSql OverflowNatural where-  sqlType _ = SqlInt64+    , EntityWithPrefix (..)+    , unPrefix+    ) where++import Data.Bits (bitSizeMaybe)+import Data.ByteString (ByteString)+import Data.Fixed+import Data.Foldable (toList)+import Data.Int+import qualified Data.IntMap as IM+import qualified Data.Map as M+import Data.Maybe (fromMaybe)+import Data.Proxy (Proxy (..))+import qualified Data.Set as S+import Data.Text (Text, intercalate, pack)+import qualified Data.Text as T+import qualified Data.Text.Lazy as TL+import Data.Time (Day, TimeOfDay, UTCTime)+import qualified Data.Vector as V+import Data.Word+import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)+import Text.Blaze.Html (Html)++import Database.Persist+import Database.Persist.Sql.Types++-- | Class for data types that may be retrived from a 'rawSql'+-- query.+class RawSql a where+    -- | Number of columns that this data type needs and the list+    -- of substitutions for @SELECT@ placeholders @??@.+    rawSqlCols :: (Text -> Text) -> a -> (Int, [Text])++    -- | A string telling the user why the column count is what+    -- it is.+    rawSqlColCountReason :: a -> String++    -- | Transform a row of the result into the data type.+    rawSqlProcessRow :: [PersistValue] -> Either Text a++instance (PersistField a) => RawSql (Single a) where+    rawSqlCols _ _ = (1, [])+    rawSqlColCountReason _ = "one column for a 'Single' data type"+    rawSqlProcessRow [pv] = Single <$> fromPersistValue pv+    rawSqlProcessRow _ = Left $ pack "RawSql (Single a): wrong number of columns."++instance+    (PersistEntity a, PersistEntityBackend a ~ backend, IsPersistBackend backend)+    => RawSql (Key a)+    where+    rawSqlCols _ key = (length $ keyToValues key, [])+    rawSqlColCountReason key =+        "The primary key is composed of "+            ++ (show $ length $ keyToValues key)+            ++ " columns"+    rawSqlProcessRow = keyFromValues++instance+    ( PersistEntity record+    , PersistEntityBackend record ~ backend+    , IsPersistBackend backend+    )+    => RawSql (Entity record)+    where+    rawSqlCols escape _ent = (length sqlFields, [intercalate ", " $ toList sqlFields])+      where+        sqlFields =+            fmap (((name <> ".") <>) . escapeWith escape) $+                fmap fieldDB $+                    keyAndEntityFields entDef+        name =+            escapeWith escape (getEntityDBName entDef)+        entDef =+            entityDef (Nothing :: Maybe record)+    rawSqlColCountReason a =+        case fst (rawSqlCols (error "RawSql") a) of+            1 -> "one column for an 'Entity' data type without fields"+            n -> show n <> " columns for an 'Entity' data type"+    rawSqlProcessRow row =+        case keyFromRecordM of+            Just mkKey -> do+                val <- fromPersistValues row+                pure+                    Entity+                        { entityKey =+                            mkKey val+                        , entityVal =+                            val+                        }+            Nothing ->+                case row of+                    (k : rest) ->+                        Entity+                            <$> keyFromValues [k]+                            <*> fromPersistValues rest+                    [] ->+                        Left "Row was empty"++-- | This newtype wrapper is useful when selecting an entity out of the+-- database and you want to provide a prefix to the table being selected.+--+-- Consider this raw SQL query:+--+-- > SELECT ??+-- > FROM my_long_table_name AS mltn+-- > INNER JOIN other_table AS ot+-- >    ON mltn.some_col = ot.other_col+-- > WHERE ...+--+-- We don't want to refer to @my_long_table_name@ every time, so we create+-- an alias. If we want to select it, we have to tell the raw SQL+-- quasi-quoter that we expect the entity to be prefixed with some other+-- name.+--+-- We can give the above query a type with this, like:+--+-- @+-- getStuff :: 'SqlPersistM' ['EntityWithPrefix' \"mltn\" MyLongTableName]+-- getStuff = rawSql queryText []+-- @+--+-- The 'EntityWithPrefix' bit is a boilerplate newtype wrapper, so you can+-- remove it with 'unPrefix', like this:+--+-- @+-- getStuff :: 'SqlPersistM' ['Entity' MyLongTableName]+-- getStuff = 'unPrefix' @\"mltn\" '<$>' 'rawSql' queryText []+-- @+--+-- The @ symbol is a "type application" and requires the @TypeApplications@+-- language extension.+--+-- @since 2.10.5+newtype EntityWithPrefix (prefix :: Symbol) record+    = EntityWithPrefix {unEntityWithPrefix :: Entity record}++-- | A helper function to tell GHC what the 'EntityWithPrefix' prefix+-- should be. This allows you to use a type application to specify the+-- prefix, instead of specifying the etype on the result.+--+-- As an example, here's code that uses this:+--+-- @+-- myQuery :: 'SqlPersistM' ['Entity' Person]+-- myQuery = fmap (unPrefix @\"p\") <$> rawSql query []+--   where+--     query = "SELECT ?? FROM person AS p"+-- @+--+-- @since 2.10.5+unPrefix+    :: forall prefix record. EntityWithPrefix prefix record -> Entity record+unPrefix = unEntityWithPrefix++instance+    ( PersistEntity record+    , KnownSymbol prefix+    , PersistEntityBackend record ~ backend+    , IsPersistBackend backend+    )+    => RawSql (EntityWithPrefix prefix record)+    where+    rawSqlCols escape _ent = (length sqlFields, [intercalate ", " $ toList sqlFields])+      where+        sqlFields =+            fmap (((name <> ".") <>) . escapeWith escape) $+                fmap fieldDB+                -- Hacky for a composite key because+                -- it selects the same field multiple times+                $+                    keyAndEntityFields entDef+        name =+            pack $ symbolVal (Proxy :: Proxy prefix)+        entDef =+            entityDef (Nothing :: Maybe record)+    rawSqlColCountReason a =+        case fst (rawSqlCols (error "RawSql") a) of+            1 -> "one column for an 'Entity' data type without fields"+            n -> show n ++ " columns for an 'Entity' data type"+    rawSqlProcessRow row =+        case splitAt nKeyFields row of+            (rowKey, rowVal) ->+                fmap EntityWithPrefix $+                    Entity+                        <$> keyFromValues rowKey+                        <*> fromPersistValues rowVal+      where+        nKeyFields = length $ getEntityKeyFields entDef+        entDef = entityDef (Nothing :: Maybe record)++-- | @since 1.0.1+instance (RawSql a) => RawSql (Maybe a) where+    rawSqlCols e = rawSqlCols e . extractMaybe+    rawSqlColCountReason = rawSqlColCountReason . extractMaybe+    rawSqlProcessRow cols+        | all isNull cols = return Nothing+        | otherwise =+            case rawSqlProcessRow cols of+                Right v -> Right (Just v)+                Left msg ->+                    Left $+                        "RawSql (Maybe a): not all columns were Null "+                            <> "but the inner parser has failed.  Its message "+                            <> "was \""+                            <> msg+                            <> "\".  Did you apply Maybe "+                            <> "to a tuple, perhaps?  The main use case for "+                            <> "Maybe is to allow OUTER JOINs to be written, "+                            <> "in which case 'Maybe (Entity v)' is used."+      where+        isNull PersistNull = True+        isNull _ = False++instance (RawSql a, RawSql b) => RawSql (a, b) where+    rawSqlCols e x = rawSqlCols e (fst x) # rawSqlCols e (snd x)+      where+        (cnta, lsta) # (cntb, lstb) = (cnta + cntb, lsta ++ lstb)+    rawSqlColCountReason x =+        rawSqlColCountReason (fst x)+            ++ ", "+            ++ rawSqlColCountReason (snd x)+    rawSqlProcessRow =+        let+            x = getType processRow+            getType :: (z -> Either y x) -> x+            getType = error "RawSql.getType"++            colCountFst = fst $ rawSqlCols (error "RawSql.getType2") (fst x)+            processRow row =+                let+                    (rowFst, rowSnd) = splitAt colCountFst row+                 in+                    (,)+                        <$> rawSqlProcessRow rowFst+                        <*> rawSqlProcessRow rowSnd+         in+            colCountFst `seq` processRow++-- Avoids recalculating 'colCountFst'.++instance (RawSql a, RawSql b, RawSql c) => RawSql (a, b, c) where+    rawSqlCols e = rawSqlCols e . from3+    rawSqlColCountReason = rawSqlColCountReason . from3+    rawSqlProcessRow = fmap to3 . rawSqlProcessRow++from3 :: (a, b, c) -> ((a, b), c)+from3 (a, b, c) = ((a, b), c)++to3 :: ((a, b), c) -> (a, b, c)+to3 ((a, b), c) = (a, b, c)++instance (RawSql a, RawSql b, RawSql c, RawSql d) => RawSql (a, b, c, d) where+    rawSqlCols e = rawSqlCols e . from4+    rawSqlColCountReason = rawSqlColCountReason . from4+    rawSqlProcessRow = fmap to4 . rawSqlProcessRow++from4 :: (a, b, c, d) -> ((a, b), (c, d))+from4 (a, b, c, d) = ((a, b), (c, d))++to4 :: ((a, b), (c, d)) -> (a, b, c, d)+to4 ((a, b), (c, d)) = (a, b, c, d)++instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    )+    => RawSql (a, b, c, d, e)+    where+    rawSqlCols e = rawSqlCols e . from5+    rawSqlColCountReason = rawSqlColCountReason . from5+    rawSqlProcessRow = fmap to5 . rawSqlProcessRow++from5 :: (a, b, c, d, e) -> ((a, b), (c, d), e)+from5 (a, b, c, d, e) = ((a, b), (c, d), e)++to5 :: ((a, b), (c, d), e) -> (a, b, c, d, e)+to5 ((a, b), (c, d), e) = (a, b, c, d, e)++instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    )+    => RawSql (a, b, c, d, e, f)+    where+    rawSqlCols e = rawSqlCols e . from6+    rawSqlColCountReason = rawSqlColCountReason . from6+    rawSqlProcessRow = fmap to6 . rawSqlProcessRow++from6 :: (a, b, c, d, e, f) -> ((a, b), (c, d), (e, f))+from6 (a, b, c, d, e, f) = ((a, b), (c, d), (e, f))++to6 :: ((a, b), (c, d), (e, f)) -> (a, b, c, d, e, f)+to6 ((a, b), (c, d), (e, f)) = (a, b, c, d, e, f)++instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    )+    => RawSql (a, b, c, d, e, f, g)+    where+    rawSqlCols e = rawSqlCols e . from7+    rawSqlColCountReason = rawSqlColCountReason . from7+    rawSqlProcessRow = fmap to7 . rawSqlProcessRow++from7 :: (a, b, c, d, e, f, g) -> ((a, b), (c, d), (e, f), g)+from7 (a, b, c, d, e, f, g) = ((a, b), (c, d), (e, f), g)++to7 :: ((a, b), (c, d), (e, f), g) -> (a, b, c, d, e, f, g)+to7 ((a, b), (c, d), (e, f), g) = (a, b, c, d, e, f, g)++instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    )+    => RawSql (a, b, c, d, e, f, g, h)+    where+    rawSqlCols e = rawSqlCols e . from8+    rawSqlColCountReason = rawSqlColCountReason . from8+    rawSqlProcessRow = fmap to8 . rawSqlProcessRow++from8 :: (a, b, c, d, e, f, g, h) -> ((a, b), (c, d), (e, f), (g, h))+from8 (a, b, c, d, e, f, g, h) = ((a, b), (c, d), (e, f), (g, h))++to8 :: ((a, b), (c, d), (e, f), (g, h)) -> (a, b, c, d, e, f, g, h)+to8 ((a, b), (c, d), (e, f), (g, h)) = (a, b, c, d, e, f, g, h)++-- | @since 2.10.2+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    )+    => RawSql (a, b, c, d, e, f, g, h, i)+    where+    rawSqlCols e = rawSqlCols e . from9+    rawSqlColCountReason = rawSqlColCountReason . from9+    rawSqlProcessRow = fmap to9 . rawSqlProcessRow++-- | @since 2.10.2+from9 :: (a, b, c, d, e, f, g, h, i) -> ((a, b), (c, d), (e, f), (g, h), i)+from9 (a, b, c, d, e, f, g, h, i) = ((a, b), (c, d), (e, f), (g, h), i)++-- | @since 2.10.2+to9 :: ((a, b), (c, d), (e, f), (g, h), i) -> (a, b, c, d, e, f, g, h, i)+to9 ((a, b), (c, d), (e, f), (g, h), i) = (a, b, c, d, e, f, g, h, i)++-- | @since 2.10.2+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j)+    where+    rawSqlCols e = rawSqlCols e . from10+    rawSqlColCountReason = rawSqlColCountReason . from10+    rawSqlProcessRow = fmap to10 . rawSqlProcessRow++-- | @since 2.10.2+from10+    :: (a, b, c, d, e, f, g, h, i, j) -> ((a, b), (c, d), (e, f), (g, h), (i, j))+from10 (a, b, c, d, e, f, g, h, i, j) = ((a, b), (c, d), (e, f), (g, h), (i, j))++-- | @since 2.10.2+to10+    :: ((a, b), (c, d), (e, f), (g, h), (i, j)) -> (a, b, c, d, e, f, g, h, i, j)+to10 ((a, b), (c, d), (e, f), (g, h), (i, j)) = (a, b, c, d, e, f, g, h, i, j)++-- | @since 2.10.2+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k)+    where+    rawSqlCols e = rawSqlCols e . from11+    rawSqlColCountReason = rawSqlColCountReason . from11+    rawSqlProcessRow = fmap to11 . rawSqlProcessRow++-- | @since 2.10.2+from11+    :: (a, b, c, d, e, f, g, h, i, j, k) -> ((a, b), (c, d), (e, f), (g, h), (i, j), k)+from11 (a, b, c, d, e, f, g, h, i, j, k) = ((a, b), (c, d), (e, f), (g, h), (i, j), k)++-- | @since 2.10.2+to11+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), k) -> (a, b, c, d, e, f, g, h, i, j, k)+to11 ((a, b), (c, d), (e, f), (g, h), (i, j), k) = (a, b, c, d, e, f, g, h, i, j, k)++-- | @since 2.10.2+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l)+    where+    rawSqlCols e = rawSqlCols e . from12+    rawSqlColCountReason = rawSqlColCountReason . from12+    rawSqlProcessRow = fmap to12 . rawSqlProcessRow++-- | @since 2.10.2+from12+    :: (a, b, c, d, e, f, g, h, i, j, k, l)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l))+from12 (a, b, c, d, e, f, g, h, i, j, k, l) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l))++-- | @since 2.10.2+to12+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l))+    -> (a, b, c, d, e, f, g, h, i, j, k, l)+to12 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l)) = (a, b, c, d, e, f, g, h, i, j, k, l)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m)+    where+    rawSqlCols e = rawSqlCols e . from13+    rawSqlColCountReason = rawSqlColCountReason . from13+    rawSqlProcessRow = fmap to13 . rawSqlProcessRow++-- | @since 2.11.0+from13+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), m)+from13 (a, b, c, d, e, f, g, h, i, j, k, l, m) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), m)++-- | @since 2.11.0+to13+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), m)+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m)+to13 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), m) = (a, b, c, d, e, f, g, h, i, j, k, l, m)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+    where+    rawSqlCols e = rawSqlCols e . from14+    rawSqlColCountReason = rawSqlColCountReason . from14+    rawSqlProcessRow = fmap to14 . rawSqlProcessRow++-- | @since 2.11.0+from14+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n))+from14 (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n))++-- | @since 2.11.0+to14+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n))+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n)+to14 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n)) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+    where+    rawSqlCols e = rawSqlCols e . from15+    rawSqlColCountReason = rawSqlColCountReason . from15+    rawSqlProcessRow = fmap to15 . rawSqlProcessRow++-- | @since 2.11.0+from15+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), o)+from15 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), o)++-- | @since 2.11.0+to15+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), o)+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)+to15 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), o) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)+    where+    rawSqlCols e = rawSqlCols e . from16+    rawSqlColCountReason = rawSqlColCountReason . from16+    rawSqlProcessRow = fmap to16 . rawSqlProcessRow++-- | @since 2.11.0+from16+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p))+from16 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p))++-- | @since 2.11.0+to16+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p))+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)+to16 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p)) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)+    where+    rawSqlCols e = rawSqlCols e . from17+    rawSqlColCountReason = rawSqlColCountReason . from17+    rawSqlProcessRow = fmap to17 . rawSqlProcessRow++-- | @since 2.11.0+from17+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), q)+from17 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), q)++-- | @since 2.11.0+to17+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), q)+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)+to17 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), q) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)+    where+    rawSqlCols e = rawSqlCols e . from18+    rawSqlColCountReason = rawSqlColCountReason . from18+    rawSqlProcessRow = fmap to18 . rawSqlProcessRow++-- | @since 2.11.0+from18+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r))+from18 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r))++-- | @since 2.11.0+to18+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r))+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)+to18 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r)) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)+    where+    rawSqlCols e = rawSqlCols e . from19+    rawSqlColCountReason = rawSqlColCountReason . from19+    rawSqlProcessRow = fmap to19 . rawSqlProcessRow++-- | @since 2.11.0+from19+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), s)+from19 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) = ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), s)++-- | @since 2.11.0+to19+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), s)+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)+to19 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), s) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)+    where+    rawSqlCols e = rawSqlCols e . from20+    rawSqlColCountReason = rawSqlColCountReason . from20+    rawSqlProcessRow = fmap to20 . rawSqlProcessRow++-- | @since 2.11.0+from20+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)+    -> ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), (s, t))+from20 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) =+    ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), (s, t))++-- | @since 2.11.0+to20+    :: ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), (s, t))+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)+to20 ((a, b), (c, d), (e, f), (g, h), (i, j), (k, l), (m, n), (o, p), (q, r), (s, t)) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)+    where+    rawSqlCols e = rawSqlCols e . from21+    rawSqlColCountReason = rawSqlColCountReason . from21+    rawSqlProcessRow = fmap to21 . rawSqlProcessRow++-- | @since 2.11.0+from21+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , u+       )+from21 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , u+    )++-- | @since 2.11.0+to21+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , u+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)+to21 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , u+        ) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)+    where+    rawSqlCols e = rawSqlCols e . from22+    rawSqlColCountReason = rawSqlColCountReason . from22+    rawSqlProcessRow = fmap to22 . rawSqlProcessRow++-- | @since 2.11.0+from22+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       )+from22 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    )++-- | @since 2.11.0+to22+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)+to22 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        ) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)+    where+    rawSqlCols e = rawSqlCols e . from23+    rawSqlColCountReason = rawSqlColCountReason . from23+    rawSqlProcessRow = fmap to23 . rawSqlProcessRow++-- | @since 2.11.0+from23+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , w+       )+from23 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , w+    )++-- | @since 2.11.0+to23+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , w+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)+to23 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , w+        ) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    )+    => RawSql (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)+    where+    rawSqlCols e = rawSqlCols e . from24+    rawSqlColCountReason = rawSqlColCountReason . from24+    rawSqlProcessRow = fmap to24 . rawSqlProcessRow++-- | @since 2.11.0+from24+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       )+from24 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    )++-- | @since 2.11.0+to24+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)+to24 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        ) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    )+    => RawSql+        (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)+    where+    rawSqlCols e = rawSqlCols e . from25+    rawSqlColCountReason = rawSqlColCountReason . from25+    rawSqlProcessRow = fmap to25 . rawSqlProcessRow++-- | @since 2.11.0+from25+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , y+       )+from25 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , y+    )++-- | @since 2.11.0+to25+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , y+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)+to25 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , y+        ) = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    )+    => RawSql+        (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)+    where+    rawSqlCols e = rawSqlCols e . from26+    rawSqlColCountReason = rawSqlColCountReason . from26+    rawSqlProcessRow = fmap to26 . rawSqlProcessRow++-- | @since 2.11.0+from26+    :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       )+from26 (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    )++-- | @since 2.11.0+to26+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       )+    -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)+to26 ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        ) =+    (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z)++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        )+    where+    rawSqlCols e = rawSqlCols e . from27+    rawSqlColCountReason = rawSqlColCountReason . from27+    rawSqlProcessRow = fmap to27 . rawSqlProcessRow++-- | @since 2.11.0+from27+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , a2+       )+from27 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , a2+    )++-- | @since 2.11.0+to27+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , a2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       )+to27+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , a2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        )+    where+    rawSqlCols e = rawSqlCols e . from28+    rawSqlColCountReason = rawSqlColCountReason . from28+    rawSqlProcessRow = fmap to28 . rawSqlProcessRow++-- | @since 2.11.0+from28+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       )+from28 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    )++-- | @since 2.11.0+to28+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       )+to28+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        )+    where+    rawSqlCols e = rawSqlCols e . from29+    rawSqlColCountReason = rawSqlColCountReason . from29+    rawSqlProcessRow = fmap to29 . rawSqlProcessRow++-- | @since 2.11.0+from29+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , c2+       )+from29 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , c2+    )++-- | @since 2.11.0+to29+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , c2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       )+to29+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , c2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        )+    where+    rawSqlCols e = rawSqlCols e . from30+    rawSqlColCountReason = rawSqlColCountReason . from30+    rawSqlProcessRow = fmap to30 . rawSqlProcessRow++-- | @since 2.11.0+from30+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       )+from30 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    )++-- | @since 2.11.0+to30+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       )+to30+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        )+    where+    rawSqlCols e = rawSqlCols e . from31+    rawSqlColCountReason = rawSqlColCountReason . from31+    rawSqlProcessRow = fmap to31 . rawSqlProcessRow++-- | @since 2.11.0+from31+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , e2+       )+from31 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    , e2+    )++-- | @since 2.11.0+to31+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , e2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       )+to31+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , e2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        )+    where+    rawSqlCols e = rawSqlCols e . from32+    rawSqlColCountReason = rawSqlColCountReason . from32+    rawSqlProcessRow = fmap to32 . rawSqlProcessRow++-- | @since 2.11.0+from32+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       )+from32 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    , (e2, f2)+    )++-- | @since 2.11.0+to32+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       )+to32+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        )+    where+    rawSqlCols e = rawSqlCols e . from33+    rawSqlColCountReason = rawSqlColCountReason . from33+    rawSqlProcessRow = fmap to33 . rawSqlProcessRow++-- | @since 2.11.0+from33+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , g2+       )+from33 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    , (e2, f2)+    , g2+    )++-- | @since 2.11.0+to33+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , g2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       )+to33+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , g2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        )+    where+    rawSqlCols e = rawSqlCols e . from34+    rawSqlColCountReason = rawSqlColCountReason . from34+    rawSqlProcessRow = fmap to34 . rawSqlProcessRow++-- | @since 2.11.0+from34+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       )+from34 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    , (e2, f2)+    , (g2, h2)+    )++-- | @since 2.11.0+to34+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       )+to34+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        )+    where+    rawSqlCols e = rawSqlCols e . from35+    rawSqlColCountReason = rawSqlColCountReason . from35+    rawSqlProcessRow = fmap to35 . rawSqlProcessRow++-- | @since 2.11.0+from35+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , i2+       )+from35 ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        ) =+    ( (a, b)+    , (c, d)+    , (e, f)+    , (g, h)+    , (i, j)+    , (k, l)+    , (m, n)+    , (o, p)+    , (q, r)+    , (s, t)+    , (u, v)+    , (w, x)+    , (y, z)+    , (a2, b2)+    , (c2, d2)+    , (e2, f2)+    , (g2, h2)+    , i2+    )++-- | @since 2.11.0+to35+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , i2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       )+to35+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , i2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        )+    where+    rawSqlCols e = rawSqlCols e . from36+    rawSqlColCountReason = rawSqlColCountReason . from36+    rawSqlProcessRow = fmap to36 . rawSqlProcessRow++-- | @since 2.11.0+from36+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       )+from36+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        )++-- | @since 2.11.0+to36+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       )+to36+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        )+    where+    rawSqlCols e = rawSqlCols e . from37+    rawSqlColCountReason = rawSqlColCountReason . from37+    rawSqlProcessRow = fmap to37 . rawSqlProcessRow++-- | @since 2.11.0+from37+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , k2+       )+from37+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , k2+        )++-- | @since 2.11.0+to37+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , k2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       )+to37+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , k2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        )+    where+    rawSqlCols e = rawSqlCols e . from38+    rawSqlColCountReason = rawSqlColCountReason . from38+    rawSqlProcessRow = fmap to38 . rawSqlProcessRow++-- | @since 2.11.0+from38+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       )+from38+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        )++-- | @since 2.11.0+to38+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       )+to38+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        )+    where+    rawSqlCols e = rawSqlCols e . from39+    rawSqlColCountReason = rawSqlColCountReason . from39+    rawSqlProcessRow = fmap to39 . rawSqlProcessRow++-- | @since 2.11.0+from39+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , m2+       )+from39+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , m2+        )++-- | @since 2.11.0+to39+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , m2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       )+to39+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , m2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        )+    where+    rawSqlCols e = rawSqlCols e . from40+    rawSqlColCountReason = rawSqlColCountReason . from40+    rawSqlProcessRow = fmap to40 . rawSqlProcessRow++-- | @since 2.11.0+from40+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       )+from40+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        )++-- | @since 2.11.0+to40+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       )+to40+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        )+    where+    rawSqlCols e = rawSqlCols e . from41+    rawSqlColCountReason = rawSqlColCountReason . from41+    rawSqlProcessRow = fmap to41 . rawSqlProcessRow++-- | @since 2.11.0+from41+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , o2+       )+from41+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , o2+        )++-- | @since 2.11.0+to41+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , o2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       )+to41+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , o2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        )+    where+    rawSqlCols e = rawSqlCols e . from42+    rawSqlColCountReason = rawSqlColCountReason . from42+    rawSqlProcessRow = fmap to42 . rawSqlProcessRow++-- | @since 2.11.0+from42+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       )+from42+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        )++-- | @since 2.11.0+to42+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       )+to42+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        )+    where+    rawSqlCols e = rawSqlCols e . from43+    rawSqlColCountReason = rawSqlColCountReason . from43+    rawSqlProcessRow = fmap to43 . rawSqlProcessRow++-- | @since 2.11.0+from43+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , q2+       )+from43+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , q2+        )++-- | @since 2.11.0+to43+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , q2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       )+to43+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , q2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        )+    where+    rawSqlCols e = rawSqlCols e . from44+    rawSqlColCountReason = rawSqlColCountReason . from44+    rawSqlProcessRow = fmap to44 . rawSqlProcessRow++-- | @since 2.11.0+from44+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       )+from44+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        )++-- | @since 2.11.0+to44+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       )+to44+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        )+    where+    rawSqlCols e = rawSqlCols e . from45+    rawSqlColCountReason = rawSqlColCountReason . from45+    rawSqlProcessRow = fmap to45 . rawSqlProcessRow++-- | @since 2.11.0+from45+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , s2+       )+from45+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , s2+        )++-- | @since 2.11.0+to45+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , s2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       )+to45+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , s2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        )+    where+    rawSqlCols e = rawSqlCols e . from46+    rawSqlColCountReason = rawSqlColCountReason . from46+    rawSqlProcessRow = fmap to46 . rawSqlProcessRow++-- | @since 2.11.0+from46+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       )+from46+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        )++-- | @since 2.11.0+to46+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       )+to46+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        )+    where+    rawSqlCols e = rawSqlCols e . from47+    rawSqlColCountReason = rawSqlColCountReason . from47+    rawSqlProcessRow = fmap to47 . rawSqlProcessRow++-- | @since 2.11.0+from47+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , u2+       )+from47+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , u2+        )++-- | @since 2.11.0+to47+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , u2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       )+to47+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , u2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        )+    where+    rawSqlCols e = rawSqlCols e . from48+    rawSqlColCountReason = rawSqlColCountReason . from48+    rawSqlProcessRow = fmap to48 . rawSqlProcessRow++-- | @since 2.11.0+from48+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       )+from48+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        )++-- | @since 2.11.0+to48+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       )+to48+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        )+    where+    rawSqlCols e = rawSqlCols e . from49+    rawSqlColCountReason = rawSqlColCountReason . from49+    rawSqlProcessRow = fmap to49 . rawSqlProcessRow++-- | @since 2.11.0+from49+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , w2+       )+from49+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , w2+        )++-- | @since 2.11.0+to49+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , w2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       )+to49+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , w2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        )+    where+    rawSqlCols e = rawSqlCols e . from50+    rawSqlColCountReason = rawSqlColCountReason . from50+    rawSqlProcessRow = fmap to50 . rawSqlProcessRow++-- | @since 2.11.0+from50+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       )+from50+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        )++-- | @since 2.11.0+to50+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       )+to50+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        )+    where+    rawSqlCols e = rawSqlCols e . from51+    rawSqlColCountReason = rawSqlColCountReason . from51+    rawSqlProcessRow = fmap to51 . rawSqlProcessRow++-- | @since 2.11.0+from51+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , y2+       )+from51+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , y2+        )++-- | @since 2.11.0+to51+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , y2+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       )+to51+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , y2+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        )+    where+    rawSqlCols e = rawSqlCols e . from52+    rawSqlColCountReason = rawSqlColCountReason . from52+    rawSqlProcessRow = fmap to52 . rawSqlProcessRow++-- | @since 2.11.0+from52+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       )+from52+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        )++-- | @since 2.11.0+to52+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       )+to52+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        )+    where+    rawSqlCols e = rawSqlCols e . from53+    rawSqlColCountReason = rawSqlColCountReason . from53+    rawSqlProcessRow = fmap to53 . rawSqlProcessRow++-- | @since 2.11.0+from53+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , a3+       )+from53+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , a3+        )++-- | @since 2.11.0+to53+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , a3+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       )+to53+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , a3+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        )+    where+    rawSqlCols e = rawSqlCols e . from54+    rawSqlColCountReason = rawSqlColCountReason . from54+    rawSqlProcessRow = fmap to54 . rawSqlProcessRow++-- | @since 2.11.0+from54+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       )+from54+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        )++-- | @since 2.11.0+to54+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       )+to54+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        )+    where+    rawSqlCols e = rawSqlCols e . from55+    rawSqlColCountReason = rawSqlColCountReason . from55+    rawSqlProcessRow = fmap to55 . rawSqlProcessRow++-- | @since 2.11.0+from55+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , c3+       )+from55+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , c3+        )++-- | @since 2.11.0+to55+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , c3+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       )+to55+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , c3+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        )+    where+    rawSqlCols e = rawSqlCols e . from56+    rawSqlColCountReason = rawSqlColCountReason . from56+    rawSqlProcessRow = fmap to56 . rawSqlProcessRow++-- | @since 2.11.0+from56+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       )+from56+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        )++-- | @since 2.11.0+to56+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       )+to56+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        )+    where+    rawSqlCols e = rawSqlCols e . from57+    rawSqlColCountReason = rawSqlColCountReason . from57+    rawSqlProcessRow = fmap to57 . rawSqlProcessRow++-- | @since 2.11.0+from57+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , e3+       )+from57+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , e3+        )++-- | @since 2.11.0+to57+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , e3+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       )+to57+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , e3+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    , RawSql f3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        )+    where+    rawSqlCols e = rawSqlCols e . from58+    rawSqlColCountReason = rawSqlColCountReason . from58+    rawSqlProcessRow = fmap to58 . rawSqlProcessRow++-- | @since 2.11.0+from58+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       )+from58+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        )++-- | @since 2.11.0+to58+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       )+to58+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    , RawSql f3+    , RawSql g3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        )+    where+    rawSqlCols e = rawSqlCols e . from59+    rawSqlColCountReason = rawSqlColCountReason . from59+    rawSqlProcessRow = fmap to59 . rawSqlProcessRow++-- | @since 2.11.0+from59+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , g3+       )+from59+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , g3+        )++-- | @since 2.11.0+to59+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , g3+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       )+to59+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , g3+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    , RawSql f3+    , RawSql g3+    , RawSql h3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        )+    where+    rawSqlCols e = rawSqlCols e . from60+    rawSqlColCountReason = rawSqlColCountReason . from60+    rawSqlProcessRow = fmap to60 . rawSqlProcessRow++-- | @since 2.11.0+from60+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       )+from60+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        )++-- | @since 2.11.0+to60+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       )+to60+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    , RawSql f3+    , RawSql g3+    , RawSql h3+    , RawSql i3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        )+    where+    rawSqlCols e = rawSqlCols e . from61+    rawSqlColCountReason = rawSqlColCountReason . from61+    rawSqlProcessRow = fmap to61 . rawSqlProcessRow++-- | @since 2.11.0+from61+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       , i3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       , i3+       )+from61+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        , i3+        )++-- | @since 2.11.0+to61+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       , i3+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       , i3+       )+to61+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        , i3+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        )++-- | @since 2.11.0+instance+    ( RawSql a+    , RawSql b+    , RawSql c+    , RawSql d+    , RawSql e+    , RawSql f+    , RawSql g+    , RawSql h+    , RawSql i+    , RawSql j+    , RawSql k+    , RawSql l+    , RawSql m+    , RawSql n+    , RawSql o+    , RawSql p+    , RawSql q+    , RawSql r+    , RawSql s+    , RawSql t+    , RawSql u+    , RawSql v+    , RawSql w+    , RawSql x+    , RawSql y+    , RawSql z+    , RawSql a2+    , RawSql b2+    , RawSql c2+    , RawSql d2+    , RawSql e2+    , RawSql f2+    , RawSql g2+    , RawSql h2+    , RawSql i2+    , RawSql j2+    , RawSql k2+    , RawSql l2+    , RawSql m2+    , RawSql n2+    , RawSql o2+    , RawSql p2+    , RawSql q2+    , RawSql r2+    , RawSql s2+    , RawSql t2+    , RawSql u2+    , RawSql v2+    , RawSql w2+    , RawSql x2+    , RawSql y2+    , RawSql z2+    , RawSql a3+    , RawSql b3+    , RawSql c3+    , RawSql d3+    , RawSql e3+    , RawSql f3+    , RawSql g3+    , RawSql h3+    , RawSql i3+    , RawSql j3+    )+    => RawSql+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        , j3+        )+    where+    rawSqlCols e = rawSqlCols e . from62+    rawSqlColCountReason = rawSqlColCountReason . from62+    rawSqlProcessRow = fmap to62 . rawSqlProcessRow++-- | @since 2.11.0+from62+    :: ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       , i3+       , j3+       )+    -> ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       , (i3, j3)+       )+from62+    ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        , j3+        ) =+        ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        , (i3, j3)+        )++-- | @since 2.11.0+to62+    :: ( (a, b)+       , (c, d)+       , (e, f)+       , (g, h)+       , (i, j)+       , (k, l)+       , (m, n)+       , (o, p)+       , (q, r)+       , (s, t)+       , (u, v)+       , (w, x)+       , (y, z)+       , (a2, b2)+       , (c2, d2)+       , (e2, f2)+       , (g2, h2)+       , (i2, j2)+       , (k2, l2)+       , (m2, n2)+       , (o2, p2)+       , (q2, r2)+       , (s2, t2)+       , (u2, v2)+       , (w2, x2)+       , (y2, z2)+       , (a3, b3)+       , (c3, d3)+       , (e3, f3)+       , (g3, h3)+       , (i3, j3)+       )+    -> ( a+       , b+       , c+       , d+       , e+       , f+       , g+       , h+       , i+       , j+       , k+       , l+       , m+       , n+       , o+       , p+       , q+       , r+       , s+       , t+       , u+       , v+       , w+       , x+       , y+       , z+       , a2+       , b2+       , c2+       , d2+       , e2+       , f2+       , g2+       , h2+       , i2+       , j2+       , k2+       , l2+       , m2+       , n2+       , o2+       , p2+       , q2+       , r2+       , s2+       , t2+       , u2+       , v2+       , w2+       , x2+       , y2+       , z2+       , a3+       , b3+       , c3+       , d3+       , e3+       , f3+       , g3+       , h3+       , i3+       , j3+       )+to62+    ( (a, b)+        , (c, d)+        , (e, f)+        , (g, h)+        , (i, j)+        , (k, l)+        , (m, n)+        , (o, p)+        , (q, r)+        , (s, t)+        , (u, v)+        , (w, x)+        , (y, z)+        , (a2, b2)+        , (c2, d2)+        , (e2, f2)+        , (g2, h2)+        , (i2, j2)+        , (k2, l2)+        , (m2, n2)+        , (o2, p2)+        , (q2, r2)+        , (s2, t2)+        , (u2, v2)+        , (w2, x2)+        , (y2, z2)+        , (a3, b3)+        , (c3, d3)+        , (e3, f3)+        , (g3, h3)+        , (i3, j3)+        ) =+        ( a+        , b+        , c+        , d+        , e+        , f+        , g+        , h+        , i+        , j+        , k+        , l+        , m+        , n+        , o+        , p+        , q+        , r+        , s+        , t+        , u+        , v+        , w+        , x+        , y+        , z+        , a2+        , b2+        , c2+        , d2+        , e2+        , f2+        , g2+        , h2+        , i2+        , j2+        , k2+        , l2+        , m2+        , n2+        , o2+        , p2+        , q2+        , r2+        , s2+        , t2+        , u2+        , v2+        , w2+        , x2+        , y2+        , z2+        , a3+        , b3+        , c3+        , d3+        , e3+        , f3+        , g3+        , h3+        , i3+        , j3+        )++extractMaybe :: Maybe a -> a+extractMaybe = fromMaybe (error "Database.Persist.GenericSql.extractMaybe")++-- | Tells Persistent what database column type should be used to store a Haskell type.+--+-- ==== __Examples__+--+-- ===== Simple Boolean Alternative+--+-- @+-- data Switch = On | Off+--   deriving (Show, Eq)+--+-- instance 'PersistField' Switch where+--   'toPersistValue' s = case s of+--     On -> 'PersistBool' True+--     Off -> 'PersistBool' False+--   'fromPersistValue' ('PersistBool' b) = if b then 'Right' On else 'Right' Off+--   'fromPersistValue' x = Left $ "File.hs: When trying to deserialize a Switch: expected PersistBool, received: " <> T.pack (show x)+--+-- instance 'PersistFieldSql' Switch where+--   'sqlType' _ = 'SqlBool'+-- @+--+-- ===== Non-Standard Database Types+--+-- If your database supports non-standard types, such as Postgres' @uuid@, you can use 'SqlOther' to use them:+--+-- @+-- import qualified Data.UUID as UUID+-- instance 'PersistField' UUID where+--   'toPersistValue' = 'PersistLiteralEncoded' . toASCIIBytes+--   'fromPersistValue' ('PersistLiteralEncoded' uuid) =+--     case fromASCIIBytes uuid of+--       'Nothing' -> 'Left' $ "Model/CustomTypes.hs: Failed to deserialize a UUID; received: " <> T.pack (show uuid)+--       'Just' uuid' -> 'Right' uuid'+--   'fromPersistValue' x = Left $ "File.hs: When trying to deserialize a UUID: expected PersistLiteralEncoded, received: "-- >  <> T.pack (show x)+--+-- instance 'PersistFieldSql' UUID where+--   'sqlType' _ = 'SqlOther' "uuid"+-- @+--+-- ===== User Created Database Types+--+-- Similarly, some databases support creating custom types, e.g. Postgres' <https://www.postgresql.org/docs/current/static/sql-createdomain.html DOMAIN> and <https://www.postgresql.org/docs/current/static/datatype-enum.html ENUM> features. You can use 'SqlOther' to specify a custom type:+--+-- > CREATE DOMAIN ssn AS text+-- >       CHECK ( value ~ '^[0-9]{9}$');+--+-- @+-- instance 'PersistFieldSQL' SSN where+--   'sqlType' _ = 'SqlOther' "ssn"+-- @+--+-- > CREATE TYPE rainbow_color AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet');+--+-- @+-- instance 'PersistFieldSQL' RainbowColor where+--   'sqlType' _ = 'SqlOther' "rainbow_color"+-- @+class (PersistField a) => PersistFieldSql a where+    sqlType :: Proxy a -> SqlType++#ifndef NO_OVERLAP+instance {-# OVERLAPPING #-} PersistFieldSql [Char] where+    sqlType _ = SqlString+#endif++instance PersistFieldSql ByteString where+    sqlType _ = SqlBlob+instance PersistFieldSql T.Text where+    sqlType _ = SqlString+instance PersistFieldSql TL.Text where+    sqlType _ = SqlString+instance PersistFieldSql Html where+    sqlType _ = SqlString+instance PersistFieldSql Int where+    sqlType _+        | Just x <- bitSizeMaybe (0 :: Int), x <= 32 = SqlInt32+        | otherwise = SqlInt64+instance PersistFieldSql Int8 where+    sqlType _ = SqlInt32+instance PersistFieldSql Int16 where+    sqlType _ = SqlInt32+instance PersistFieldSql Int32 where+    sqlType _ = SqlInt32+instance PersistFieldSql Int64 where+    sqlType _ = SqlInt64+instance PersistFieldSql Word where+    sqlType _ = SqlInt64+instance PersistFieldSql Word8 where+    sqlType _ = SqlInt32+instance PersistFieldSql Word16 where+    sqlType _ = SqlInt32+instance PersistFieldSql Word32 where+    sqlType _ = SqlInt64+instance PersistFieldSql Word64 where+    sqlType _ = SqlInt64+instance PersistFieldSql Double where+    sqlType _ = SqlReal+instance PersistFieldSql Bool where+    sqlType _ = SqlBool+instance PersistFieldSql Day where+    sqlType _ = SqlDay+instance PersistFieldSql TimeOfDay where+    sqlType _ = SqlTime+instance PersistFieldSql UTCTime where+    sqlType _ = SqlDayTime+instance (PersistFieldSql a) => PersistFieldSql (Maybe a) where+    sqlType _ = sqlType (Proxy :: Proxy a)+instance {-# OVERLAPPABLE #-} (PersistFieldSql a) => PersistFieldSql [a] where+    sqlType _ = SqlString+instance (PersistFieldSql a) => PersistFieldSql (V.Vector a) where+    sqlType _ = SqlString+instance (Ord a, PersistFieldSql a) => PersistFieldSql (S.Set a) where+    sqlType _ = SqlString+instance (PersistFieldSql a, PersistFieldSql b) => PersistFieldSql (a, b) where+    sqlType _ = SqlString+instance (PersistFieldSql v) => PersistFieldSql (IM.IntMap v) where+    sqlType _ = SqlString+instance (PersistFieldSql v) => PersistFieldSql (M.Map T.Text v) where+    sqlType _ = SqlString+instance PersistFieldSql PersistValue where+    sqlType _ = SqlInt64 -- since PersistValue should only be used like this for keys, which in SQL are Int64+instance PersistFieldSql Checkmark where+    sqlType _ = SqlBool+instance (HasResolution a) => PersistFieldSql (Fixed a) where+    sqlType a =+        SqlNumeric long prec+      where+        prec = round $ (log $ fromIntegral $ resolution n) / (log 10 :: Double) --  FIXME: May lead to problems with big numbers+        long = prec + 10 --  FIXME: Is this enough ?+        n = 0+        _mn = return n `asTypeOf` a++instance PersistFieldSql Rational where+    sqlType _ = SqlNumeric 32 20 --  need to make this field big enough to handle Rational to Mumber string conversion for ODBC++-- | This type uses the 'SqlInt64' version, which will exhibit overflow and+-- underflow behavior. Additionally, it permits negative values in the+-- database, which isn't ideal.+--+-- @since 2.11.0+instance PersistFieldSql OverflowNatural where+    sqlType _ = SqlInt64  -- An embedded Entity instance (PersistField record, PersistEntity record) => PersistFieldSql (Entity record) where
Database/Persist/Sql/Internal.hs view
@@ -7,7 +7,7 @@ module Database.Persist.Sql.Internal     ( mkColumns     , defaultAttribute-    , BackendSpecificOverrides(..)+    , BackendSpecificOverrides (..)     , getBackendSpecificForeignKeyName     , setBackendSpecificForeignKeyName     , emptyBackendSpecificOverrides@@ -34,7 +34,8 @@ -- -- @since 2.11 data BackendSpecificOverrides = BackendSpecificOverrides-    { backendSpecificForeignKeyName :: Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB)+    { backendSpecificForeignKeyName+        :: Maybe (EntityNameDB -> FieldNameDB -> ConstraintNameDB)     }  -- | If the override is defined, then this returns a function that accepts an@@ -58,7 +59,7 @@     -> BackendSpecificOverrides     -> BackendSpecificOverrides setBackendSpecificForeignKeyName func bso =-    bso { backendSpecificForeignKeyName = Just func }+    bso{backendSpecificForeignKeyName = Just func}  findMaybe :: (a -> Maybe b) -> [a] -> Maybe b findMaybe p = listToMaybe . mapMaybe p@@ -108,26 +109,25 @@                         -- a value into the database without ever asking                         -- for a default attribute.                         Nothing-                        -- But we need to be able to say "Hey, if this is-                        -- an *auto generated ID column*, then I need to-                        -- specify that it has the default serial picking-                        -- behavior for whatever SQL backend this is using.-                        -- Because naturally MySQL, Postgres, MSSQL, etc-                        -- all do ths differently, sigh.-                        -- Really, this should be something like,-                        ---                        -- > data ColumnDefault-                        -- >     = Custom Text-                        -- >     | AutogenerateId-                        -- >     | NoDefault-                        ---                        -- where Autogenerated is determined by the-                        -- MkPersistSettings.+                    -- But we need to be able to say "Hey, if this is+                    -- an *auto generated ID column*, then I need to+                    -- specify that it has the default serial picking+                    -- behavior for whatever SQL backend this is using.+                    -- Because naturally MySQL, Postgres, MSSQL, etc+                    -- all do ths differently, sigh.+                    -- Really, this should be something like,+                    --+                    -- > data ColumnDefault+                    -- >     = Custom Text+                    -- >     | AutogenerateId+                    -- >     | NoDefault+                    --+                    -- where Autogenerated is determined by the+                    -- MkPersistSettings.                     Just def ->                         Just def-             , cGenerated = fieldGenerated fd-            , cDefaultConstraintName =  Nothing+            , cDefaultConstraintName = Nothing             , cMaxLen = maxLen $ fieldAttrs fd             , cReference = mkColumnReference fd             }@@ -146,7 +146,7 @@             , cSqlType = fieldSqlType fd             , cDefault = defaultAttribute $ fieldAttrs fd             , cGenerated = fieldGenerated fd-            , cDefaultConstraintName =  Nothing+            , cDefaultConstraintName = Nothing             , cMaxLen = maxLen $ fieldAttrs fd             , cReference = mkColumnReference fd             }@@ -161,21 +161,22 @@     mkColumnReference :: FieldDef -> Maybe ColumnReference     mkColumnReference fd =         fmap-            (\(tName, cName) ->+            ( \(tName, cName) ->                 ColumnReference tName cName $ overrideNothings $ fieldCascade fd             )-        $ ref (fieldDB fd) (fieldReference fd) (fieldAttrs fd)+            $ ref (fieldDB fd) (fieldReference fd) (fieldAttrs fd)      -- a 'Nothing' in the definition means that the QQ migration doesn't     -- specify behavior. the default is RESTRICT. setting this here     -- explicitly makes migrations run smoother.-    overrideNothings (FieldCascade { fcOnUpdate = upd, fcOnDelete = del }) =+    overrideNothings (FieldCascade{fcOnUpdate = upd, fcOnDelete = del}) =         FieldCascade             { fcOnUpdate = upd <|> Just Restrict             , fcOnDelete = del <|> Just Restrict             } -    ref :: FieldNameDB+    ref+        :: FieldNameDB         -> ReferenceDef         -> [FieldAttr]         -> Maybe (EntityNameDB, ConstraintNameDB) -- table name, constraint name@@ -183,11 +184,11 @@         | ForeignRef f <- fe =             Just (resolveTableName allDefs f, refNameFn tableName c)         | otherwise = Nothing-    ref _ _ (FieldAttrNoreference:_) = Nothing-    ref c fe (a:as) = case a of+    ref _ _ (FieldAttrNoreference : _) = Nothing+    ref c fe (a : as) = case a of         FieldAttrReference x -> do             (_, constraintName) <- ref c fe as-            pure (EntityNameDB  x, constraintName)+            pure (EntityNameDB x, constraintName)         FieldAttrConstraint x -> do             (tableName_, _) <- ref c fe as             pure (tableName_, ConstraintNameDB x)@@ -199,6 +200,6 @@  resolveTableName :: [EntityDef] -> EntityNameHS -> EntityNameDB resolveTableName [] (EntityNameHS t) = error $ "Table not found: " `Data.Monoid.mappend` T.unpack t-resolveTableName (e:es) hn+resolveTableName (e : es) hn     | getEntityHaskellName e == hn = getEntityDBName e     | otherwise = resolveTableName es hn
Database/Persist/Sql/Migration.hs view
@@ -2,64 +2,66 @@ -- -- A 'Migration' is (currently) an alias for a 'WriterT' of module Database.Persist.Sql.Migration-  (-    -- * Types-    Migration-  , CautiousMigration-  , Sql-    -- * Using a 'Migration'-  , showMigration-  , parseMigration-  , parseMigration'-  , printMigration-  , getMigration-  , runMigration-  , runMigrationQuiet-  , runMigrationSilent-  , runMigrationUnsafe-  , runMigrationUnsafeQuiet-  , migrate-  -- * Utilities for constructing migrations-  -- | While 'migrate' is capable of creating a 'Migration' for you, it's not-  -- the only way you can write migrations. You can use these utilities to write-  -- extra steps in your migrations.-  ---  -- As an example, let's say we want to enable the @citext@ extension on-  -- @postgres@ as part of our migrations.-  ---  -- @-  -- 'Database.Persist.TH.share' ['Database.Persist.TH.mkPersist' sqlSettings, 'Database.Persist.TH.mkMigration' "migrateAll"] ...-  ---  -- migration :: 'Migration'-  -- migration = do-  --     'runSqlCommand' $-  --         'rawExecute_' "CREATE EXTENSION IF NOT EXISTS \"citext\";"-  --     migrateAll-  -- @-  ---  -- For raw commands, you can also just write 'addMigration':-  ---  -- @-  -- migration :: 'Migration'-  -- migration = do-  --     'addMigration' "CREATE EXTENSION IF NOT EXISTS \"citext\";"-  --     migrateAll-  -- @-  , reportErrors-  , reportError-  , addMigrations-  , addMigration-  , runSqlCommand-  -- * If something goes wrong...-  , PersistUnsafeMigrationException(..)-  ) where+    ( -- * Types+      Migration+    , CautiousMigration+    , Sql +      -- * Using a 'Migration'+    , showMigration+    , parseMigration+    , parseMigration'+    , printMigration+    , getMigration+    , runMigration+    , runMigrationQuiet+    , runMigrationSilent+    , runMigrationUnsafe+    , runMigrationUnsafeQuiet+    , migrate +      -- * Utilities for constructing migrations++      -- | While 'migrate' is capable of creating a 'Migration' for you, it's not+      -- the only way you can write migrations. You can use these utilities to write+      -- extra steps in your migrations.+      --+      -- As an example, let's say we want to enable the @citext@ extension on+      -- @postgres@ as part of our migrations.+      --+      -- @+      -- 'Database.Persist.TH.share' ['Database.Persist.TH.mkPersist' sqlSettings, 'Database.Persist.TH.mkMigration' "migrateAll"] ...+      --+      -- migration :: 'Migration'+      -- migration = do+      --     'runSqlCommand' $+      --         'rawExecute_' "CREATE EXTENSION IF NOT EXISTS \"citext\";"+      --     migrateAll+      -- @+      --+      -- For raw commands, you can also just write 'addMigration':+      --+      -- @+      -- migration :: 'Migration'+      -- migration = do+      --     'addMigration' "CREATE EXTENSION IF NOT EXISTS \"citext\";"+      --     migrateAll+      -- @+    , reportErrors+    , reportError+    , addMigrations+    , addMigration+    , runSqlCommand++      -- * If something goes wrong...+    , PersistUnsafeMigrationException (..)+    ) where+ import Control.Exception (throwIO) import Control.Monad (liftM, unless) import Control.Monad.IO.Unlift-import Control.Monad.Trans.Class (MonadTrans(..))-import Control.Monad.Trans.Reader (ReaderT(..), ask)+import Control.Monad.Trans.Class (MonadTrans (..))+import Control.Monad.Trans.Reader (ReaderT (..), ask) import Control.Monad.Trans.Writer import Data.Text (Text, isPrefixOf, pack, snoc, unpack) import qualified Data.Text.IO@@ -67,12 +69,12 @@ import System.IO import System.IO.Silently (hSilence) +import Control.Exception (Exception (..)) import Database.Persist.Sql.Orphan.PersistStore () import Database.Persist.Sql.Raw import Database.Persist.Sql.Types import Database.Persist.Sql.Types.Internal import Database.Persist.Types-import Control.Exception (Exception(..))  type Sql = Text @@ -90,7 +92,8 @@ -- * @'ReaderT' 'SqlBackend'@, aka the 'SqlPersistT' transformer for --   database interop. -- * @'IO'@ for arbitrary IO.-type Migration = WriterT [Text] (WriterT CautiousMigration (ReaderT SqlBackend IO)) ()+type Migration =+    WriterT [Text] (WriterT CautiousMigration (ReaderT SqlBackend IO)) ()  allSql :: CautiousMigration -> [Sql] allSql = map snd@@ -100,7 +103,9 @@  -- | Given a 'Migration', this parses it and returns either a list of -- errors associated with the migration or a list of migrations to do.-parseMigration :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m (Either [Text] CautiousMigration)+parseMigration+    :: (HasCallStack, MonadIO m)+    => Migration -> ReaderT SqlBackend m (Either [Text] CautiousMigration) parseMigration =     liftIOReader . liftM go . runWriterT . execWriterT   where@@ -111,35 +116,41 @@  -- | Like 'parseMigration', but instead of returning the value in an -- 'Either' value, it calls 'error' on the error values.-parseMigration' :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m CautiousMigration+parseMigration'+    :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m CautiousMigration parseMigration' m = do-  x <- parseMigration m-  case x of-      Left errs -> error $ unlines $ map unpack errs-      Right sql -> return sql+    x <- parseMigration m+    case x of+        Left errs -> error $ unlines $ map unpack errs+        Right sql -> return sql  -- | Prints a migration.-printMigration :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m ()-printMigration m = showMigration m-               >>= mapM_ (liftIO . Data.Text.IO.putStrLn)+printMigration+    :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m ()+printMigration m =+    showMigration m+        >>= mapM_ (liftIO . Data.Text.IO.putStrLn)  -- | Convert a 'Migration' to a list of 'Text' values corresponding to their -- 'Sql' statements.-showMigration :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text]+showMigration+    :: (HasCallStack, MonadIO m) => Migration -> ReaderT SqlBackend m [Text] showMigration m = map (flip snoc ';') `liftM` getMigration m  -- | Return all of the 'Sql' values associated with the given migration. -- Calls 'error' if there's a parse error on any migration.-getMigration :: (MonadIO m, HasCallStack) => Migration -> ReaderT SqlBackend m [Sql]+getMigration+    :: (MonadIO m, HasCallStack) => Migration -> ReaderT SqlBackend m [Sql] getMigration m = do-  mig <- parseMigration' m-  return $ allSql mig+    mig <- parseMigration' m+    return $ allSql mig  -- | Runs a migration. If the migration fails to parse or if any of the -- migrations are unsafe, then this throws a 'PersistUnsafeMigrationException'.-runMigration :: MonadIO m-             => Migration-             -> ReaderT SqlBackend m ()+runMigration+    :: (MonadIO m)+    => Migration+    -> ReaderT SqlBackend m () runMigration m = runMigration' m False >> return ()  -- | Same as 'runMigration', but does not report the individual migrations on@@ -150,9 +161,10 @@ -- persistent-postgresql -- -- @since 2.10.2-runMigrationQuiet :: MonadIO m-                  => Migration-                  -> ReaderT SqlBackend m [Text]+runMigrationQuiet+    :: (MonadIO m)+    => Migration+    -> ReaderT SqlBackend m [Text] runMigrationQuiet m = runMigration' m True  -- | Same as 'runMigration', but returns a list of the SQL commands executed@@ -162,11 +174,12 @@ -- is not thread-safe and can clobber output from other parts of the program. -- This implementation method was chosen to also silence postgresql migration -- output on stderr, but is not recommended!-runMigrationSilent :: MonadUnliftIO m-                   => Migration-                   -> ReaderT SqlBackend m [Text]+runMigrationSilent+    :: (MonadUnliftIO m)+    => Migration+    -> ReaderT SqlBackend m [Text] runMigrationSilent m = withRunInIO $ \run ->-  hSilence [stderr] $ run $ runMigration' m True+    hSilence [stderr] $ run $ runMigration' m True  -- | Run the given migration against the database. If the migration fails -- to parse, or there are any unsafe migrations, then this will error at@@ -174,7 +187,8 @@ runMigration'     :: (HasCallStack, MonadIO m)     => Migration-    -> Bool -- ^ is silent?+    -> Bool+    -- ^ is silent?     -> ReaderT SqlBackend m [Text] runMigration' m silent = do     mig <- parseMigration' m@@ -184,29 +198,32 @@  -- | Like 'runMigration', but this will perform the unsafe database -- migrations instead of erroring out.-runMigrationUnsafe :: MonadIO m-                   => Migration-                   -> ReaderT SqlBackend m ()+runMigrationUnsafe+    :: (MonadIO m)+    => Migration+    -> ReaderT SqlBackend m () runMigrationUnsafe m = runMigrationUnsafe' False m >> return ()  -- | Same as 'runMigrationUnsafe', but returns a list of the SQL commands -- executed instead of printing them to stderr. -- -- @since 2.10.2-runMigrationUnsafeQuiet :: (HasCallStack, MonadIO m)-                        => Migration-                        -> ReaderT SqlBackend m [Text]+runMigrationUnsafeQuiet+    :: (HasCallStack, MonadIO m)+    => Migration+    -> ReaderT SqlBackend m [Text] runMigrationUnsafeQuiet = runMigrationUnsafe' True -runMigrationUnsafe' :: (HasCallStack, MonadIO m)-                    => Bool-                    -> Migration-                    -> ReaderT SqlBackend m [Text]+runMigrationUnsafe'+    :: (HasCallStack, MonadIO m)+    => Bool+    -> Migration+    -> ReaderT SqlBackend m [Text] runMigrationUnsafe' silent m = do     mig <- parseMigration' m     mapM (executeMigrate silent) $ sortMigrations $ allSql mig -executeMigrate :: MonadIO m => Bool -> Text -> ReaderT SqlBackend m Text+executeMigrate :: (MonadIO m) => Bool -> Text -> ReaderT SqlBackend m Text executeMigrate silent s = do     unless silent $ liftIO $ hPutStrLn stderr $ "Migrating: " ++ unpack s     rawExecute s []@@ -225,9 +242,10 @@ -- |  Given a list of old entity definitions and a new 'EntityDef' in -- @val@, this creates a 'Migration' to update the old list of definitions -- with the new one.-migrate :: [EntityDef]-        -> EntityDef-        -> Migration+migrate+    :: [EntityDef]+    -> EntityDef+    -> Migration migrate allDefs val = do     conn <- lift $ lift ask     res <- liftIO $ connMigrateSql conn allDefs (getStmtConn conn) val@@ -286,21 +304,21 @@ -- -- @since 2.11.1.0 newtype PersistUnsafeMigrationException-  = PersistUnsafeMigrationException [(Bool, Sql)]+    = PersistUnsafeMigrationException [(Bool, Sql)]  -- | This 'Show' instance renders an error message suitable for printing to the -- console. This is a little dodgy, but since GHC uses Show instances when -- displaying uncaught exceptions, we have little choice. instance Show PersistUnsafeMigrationException where-  show (PersistUnsafeMigrationException mig) =-    concat-      [ "\n\nDatabase migration: manual intervention required.\n"-      , "The unsafe actions are prefixed by '***' below:\n\n"-      , unlines $ map displayMigration mig-      ]-    where-      displayMigration :: (Bool, Sql) -> String-      displayMigration (True,  s) = "*** " ++ unpack s ++ ";"-      displayMigration (False, s) = "    " ++ unpack s ++ ";"+    show (PersistUnsafeMigrationException mig) =+        concat+            [ "\n\nDatabase migration: manual intervention required.\n"+            , "The unsafe actions are prefixed by '***' below:\n\n"+            , unlines $ map displayMigration mig+            ]+      where+        displayMigration :: (Bool, Sql) -> String+        displayMigration (True, s) = "*** " ++ unpack s ++ ";"+        displayMigration (False, s) = "    " ++ unpack s ++ ";"  instance Exception PersistUnsafeMigrationException
Database/Persist/Sql/Orphan/PersistQuery.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeOperators #-}- {-# OPTIONS_GHC -fno-warn-orphans #-}  -- | TODO: delete this module and get it in with SqlBackend.Internal@@ -26,7 +25,7 @@ import Data.Int (Int64) import Data.List (find, inits, transpose) import Data.Maybe (isJust)-import Data.Monoid (Monoid(..))+import Data.Monoid (Monoid (..)) import Data.Text (Text) import qualified Data.Text as T @@ -34,54 +33,67 @@ import Database.Persist.Sql.Orphan.PersistStore (withRawQuery) import Database.Persist.Sql.Raw import Database.Persist.Sql.Types.Internal-       (SqlBackend(..), SqlReadBackend, SqlWriteBackend)+    ( SqlBackend (..)+    , SqlReadBackend+    , SqlWriteBackend+    ) import Database.Persist.Sql.Util-       ( commaSeparated-       , dbIdColumns-       , isIdField-       , keyAndEntityColumnNames-       , mkUpdateText-       , parseEntityValues-       , parseExistsResult-       , updatePersistValue-       )+    ( commaSeparated+    , dbIdColumns+    , isIdField+    , keyAndEntityColumnNames+    , mkUpdateText+    , parseEntityValues+    , parseExistsResult+    , updatePersistValue+    )  -- orphaned instance for convenience of modularity instance PersistQueryRead SqlBackend where     count filts = do         conn <- ask-        let wher = if null filts+        let+            wher =+                if null filts                     then ""                     else filterClause Nothing conn filts-        let sql = mconcat-                [ "SELECT COUNT(*) FROM "-                , connEscapeTableName conn t-                , wher-                ]+        let+            sql =+                mconcat+                    [ "SELECT COUNT(*) FROM "+                    , connEscapeTableName conn t+                    , wher+                    ]         withRawQuery sql (getFiltsValues conn filts) $ do             mm <- CL.head             case mm of-              Just [PersistInt64 i] -> return $ fromIntegral i-              Just [PersistDouble i] ->return $ fromIntegral (truncate i :: Int64) -- gb oracle-              Just [PersistByteString i] -> case readInteger i of -- gb mssql-                                              Just (ret,"") -> return $ fromIntegral ret-                                              xs -> error $ "invalid number i["++show i++"] xs[" ++ show xs ++ "]"-              Just xs -> error $ "count:invalid sql  return xs["++show xs++"] sql["++show sql++"]"-              Nothing -> error $ "count:invalid sql returned nothing sql["++show sql++"]"+                Just [PersistInt64 i] -> return $ fromIntegral i+                Just [PersistDouble i] -> return $ fromIntegral (truncate i :: Int64) -- gb oracle+                Just [PersistByteString i] -> case readInteger i of -- gb mssql+                    Just (ret, "") -> return $ fromIntegral ret+                    xs -> error $ "invalid number i[" ++ show i ++ "] xs[" ++ show xs ++ "]"+                Just xs ->+                    error $+                        "count:invalid sql  return xs[" ++ show xs ++ "] sql[" ++ show sql ++ "]"+                Nothing -> error $ "count:invalid sql returned nothing sql[" ++ show sql ++ "]"       where         t = entityDef $ dummyFromFilts filts      exists filts = do         conn <- ask-        let wher = if null filts+        let+            wher =+                if null filts                     then ""                     else filterClause Nothing conn filts-        let sql = mconcat-                [ "SELECT EXISTS(SELECT 1 FROM "-                , connEscapeTableName conn t-                , wher-                , ")"-                ]+        let+            sql =+                mconcat+                    [ "SELECT EXISTS(SELECT 1 FROM "+                    , connEscapeTableName conn t+                    , wher+                    , ")"+                    ]         withRawQuery sql (getFiltsValues conn filts) $ do             mm <- CL.head             return $ parseExistsResult mm sql "PersistQuery.exists"@@ -98,24 +110,29 @@         parse vals =             case parseEntityValues t vals of                 Left s ->-                    liftIO $ throwIO $-                        PersistMarshalError ("selectSourceRes: " <> s <> ", vals: " <> T.pack (show vals ))+                    liftIO $+                        throwIO $+                            PersistMarshalError+                                ("selectSourceRes: " <> s <> ", vals: " <> T.pack (show vals))                 Right row ->                     return row         t = entityDef $ dummyFromFilts filts-        wher conn = if null filts-                    then ""-                    else filterClause Nothing conn filts+        wher conn =+            if null filts+                then ""+                else filterClause Nothing conn filts         ord conn = orderClause Nothing conn orders         cols = commaSeparated . toList . keyAndEntityColumnNames t-        sql conn = connLimitOffset conn (limit,offset) $ mconcat-            [ "SELECT "-            , cols conn-            , " FROM "-            , connEscapeTableName conn t-            , wher conn-            , ord conn-            ]+        sql conn =+            connLimitOffset conn (limit, offset) $+                mconcat+                    [ "SELECT "+                    , cols conn+                    , " FROM "+                    , connEscapeTableName conn t+                    , wher conn+                    , ord conn+                    ]      selectKeysRes filts opts = do         conn <- ask@@ -125,18 +142,20 @@         t = entityDef $ dummyFromFilts filts         cols conn = T.intercalate "," $ toList $ dbIdColumns conn t --        wher conn = if null filts-                    then ""-                    else filterClause Nothing conn filts-        sql conn = connLimitOffset conn (limit,offset) $ mconcat-            [ "SELECT "-            , cols conn-            , " FROM "-            , connEscapeTableName conn t-            , wher conn-            , ord conn-            ]+        wher conn =+            if null filts+                then ""+                else filterClause Nothing conn filts+        sql conn =+            connLimitOffset conn (limit, offset) $+                mconcat+                    [ "SELECT "+                    , cols conn+                    , " FROM "+                    , connEscapeTableName conn t+                    , wher conn+                    , ord conn+                    ]          (limit, offset, orders) = limitOffsetOrder opts @@ -144,15 +163,20 @@          parse xs = do             keyvals <- case entityPrimary t of-                      Nothing ->-                        case xs of-                           [PersistInt64 x] -> return [PersistInt64 x]-                           [PersistDouble x] -> return [PersistInt64 (truncate x)] -- oracle returns Double-                           _ -> return xs-                      Just pdef ->-                           let pks = map fieldHaskell $ toList $ compositeFields pdef-                               keyvals = map snd $ filter (\(a, _) -> let ret=isJust (find (== a) pks) in ret) $ zip (map fieldHaskell $ getEntityFields t) xs-                           in return keyvals+                Nothing ->+                    case xs of+                        [PersistInt64 x] -> return [PersistInt64 x]+                        [PersistDouble x] -> return [PersistInt64 (truncate x)] -- oracle returns Double+                        _ -> return xs+                Just pdef ->+                    let+                        pks = map fieldHaskell $ toList $ compositeFields pdef+                        keyvals =+                            map snd $+                                filter (\(a, _) -> let ret = isJust (find (== a) pks) in ret) $+                                    zip (map fieldHaskell $ getEntityFields t) xs+                     in+                        return keyvals             case keyFromValues keyvals of                 Right k -> return k                 Left err -> error $ "selectKeysImpl: keyFromValues failed" <> show err@@ -181,56 +205,80 @@ -- | Same as 'deleteWhere', but returns the number of rows affected. -- -- @since 1.1.5-deleteWhereCount :: (PersistEntity val, MonadIO m, PersistEntityBackend val ~ SqlBackend, BackendCompatible SqlBackend backend)-                 => [Filter val]-                 -> ReaderT backend m Int64+deleteWhereCount+    :: ( PersistEntity val+       , MonadIO m+       , PersistEntityBackend val ~ SqlBackend+       , BackendCompatible SqlBackend backend+       )+    => [Filter val]+    -> ReaderT backend m Int64 deleteWhereCount filts = withCompatibleBackend $ do     conn <- ask-    let t = entityDef $ dummyFromFilts filts-    let wher = if null filts+    let+        t = entityDef $ dummyFromFilts filts+    let+        wher =+            if null filts                 then ""                 else filterClause Nothing conn filts-        sql = mconcat-            [ "DELETE FROM "-            , connEscapeTableName conn t-            , wher-            ]+        sql =+            mconcat+                [ "DELETE FROM "+                , connEscapeTableName conn t+                , wher+                ]     rawExecuteCount sql $ getFiltsValues conn filts  -- | Same as 'updateWhere', but returns the number of rows affected. -- -- @since 1.1.5-updateWhereCount :: (PersistEntity val, MonadIO m, SqlBackend ~ PersistEntityBackend val, BackendCompatible SqlBackend backend)-                 => [Filter val]-                 -> [Update val]-                 -> ReaderT backend m Int64+updateWhereCount+    :: ( PersistEntity val+       , MonadIO m+       , SqlBackend ~ PersistEntityBackend val+       , BackendCompatible SqlBackend backend+       )+    => [Filter val]+    -> [Update val]+    -> ReaderT backend m Int64 updateWhereCount _ [] = return 0 updateWhereCount filts upds = withCompatibleBackend $ do     conn <- ask-    let wher = if null filts+    let+        wher =+            if null filts                 then ""                 else filterClause Nothing conn filts-    let sql = mconcat-            [ "UPDATE "-            , connEscapeTableName conn t-            , " SET "-            , T.intercalate "," $ map (mkUpdateText conn) upds-            , wher-            ]-    let dat = map updatePersistValue upds `Data.Monoid.mappend`-              getFiltsValues conn filts+    let+        sql =+            mconcat+                [ "UPDATE "+                , connEscapeTableName conn t+                , " SET "+                , T.intercalate "," $ map (mkUpdateText conn) upds+                , wher+                ]+    let+        dat =+            map updatePersistValue upds+                `Data.Monoid.mappend` getFiltsValues conn filts     rawExecuteCount sql dat   where     t = entityDef $ dummyFromFilts filts -fieldName ::  forall record typ. (PersistEntity record) => EntityField record typ -> FieldNameDB+fieldName+    :: forall record typ+     . (PersistEntity record) => EntityField record typ -> FieldNameDB fieldName f = fieldDB $ persistFieldDef f  dummyFromFilts :: [Filter v] -> Maybe v dummyFromFilts _ = Nothing -getFiltsValues :: forall val. (PersistEntity val)-               => SqlBackend -> [Filter val] -> [PersistValue]+getFiltsValues+    :: forall val+     . (PersistEntity val)+    => SqlBackend -> [Filter val] -> [PersistValue] getFiltsValues conn = snd . filterClauseHelper Nothing False conn OrNullNo  data OrNull = OrNullYes | OrNullNo@@ -239,22 +287,24 @@ -- -- @since 2.12.1.0 data FilterTablePrefix-    = PrefixTableName-    -- ^ Prefix the column with the table name. This is useful if the column-    -- name might be ambiguous.-    ---    -- @since 2.12.1.0-    | PrefixExcluded-    -- ^ Prefix the column name with the @EXCLUDED@ keyword. This is used with-    -- the Postgresql backend when doing @ON CONFLICT DO UPDATE@ clauses - see-    -- the documentation on @upsertWhere@ and @upsertManyWhere@.-    ---    -- @since 2.12.1.0+    = -- | Prefix the column with the table name. This is useful if the column+      -- name might be ambiguous.+      --+      -- @since 2.12.1.0+      PrefixTableName+    | -- | Prefix the column name with the @EXCLUDED@ keyword. This is used with+      -- the Postgresql backend when doing @ON CONFLICT DO UPDATE@ clauses - see+      -- the documentation on @upsertWhere@ and @upsertManyWhere@.+      --+      -- @since 2.12.1.0+      PrefixExcluded  prefixByTable     :: Maybe FilterTablePrefix-    -> Text -- ^ Table name-    -> (Text -> Text) -- ^ Prefixing function+    -> Text+    -- ^ Table name+    -> (Text -> Text)+    -- ^ Prefixing function prefixByTable tablePrefix tableName =     case tablePrefix of         Just PrefixTableName -> ((tableName <> ".") <>)@@ -263,16 +313,20 @@  filterClauseHelper     :: (PersistEntity val)-    => Maybe FilterTablePrefix -- ^ include table name or PostgresSQL EXCLUDED-    -> Bool -- ^ include WHERE+    => Maybe FilterTablePrefix+    -- ^ include table name or PostgresSQL EXCLUDED+    -> Bool+    -- ^ include WHERE     -> SqlBackend     -> OrNull     -> [Filter val]     -> (Text, [PersistValue]) filterClauseHelper tablePrefix includeWhere conn orNull filters =-    (if not (T.null sql) && includeWhere+    ( if not (T.null sql) && includeWhere         then " WHERE " <> sql-        else sql, vals)+        else sql+    , vals+    )   where     (sql, vals) = combineAND filters     combineAND = combine " AND "@@ -287,112 +341,186 @@     go (FilterAnd []) = ("1=1", [])     go (FilterAnd fs) = combineAND fs     go (FilterOr []) = ("1=0", [])-    go (FilterOr fs)  = combine " OR " fs+    go (FilterOr fs) = combine " OR " fs     go (Filter field value pfilter) =-        let t = entityDef $ dummyFromFilts [Filter field value pfilter]-        in+        let+            t = entityDef $ dummyFromFilts [Filter field value pfilter]+         in             case (isIdField field, entityPrimary t, allVals) of-                (True, Just pdef, PersistList ys:_) ->-                    let cfields = toList $ compositeFields pdef in-                    if length cfields /= length ys-                    then error $ "wrong number of entries in compositeFields vs PersistList allVals=" ++ show allVals-                    else-                        case (allVals, pfilter, isCompFilter pfilter) of-                            ([PersistList xs], Eq, _) ->-                                let-                                    sqlcl =-                                        T.intercalate " and "-                                        (map (\a -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "? ")  cfields)-                                in-                                    (wrapSql sqlcl, xs)-                            ([PersistList xs], Ne, _) ->-                                let-                                    sqlcl =-                                        T.intercalate " or " (map (\a -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "? ")  cfields)-                                in-                                    (wrapSql sqlcl, xs)-                            (_, In, _) ->-                               let xxs = transpose (map fromPersistList allVals)-                                   sqls=map (\(a,xs) -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "(" <> T.intercalate "," (replicate (length xs) " ?") <> ") ") (zip cfields xxs)-                               in (wrapSql (T.intercalate " and " (map wrapSql sqls)), concat xxs)-                            (_, NotIn, _) ->-                                let-                                    xxs = transpose (map fromPersistList allVals)-                                    sqls = map (\(a,xs) -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "(" <> T.intercalate "," (replicate (length xs) " ?") <> ") ") (zip cfields xxs)-                                in-                                    (wrapSql (T.intercalate " or " (map wrapSql sqls)), concat xxs)-                            ([PersistList xs], _, True) ->-                               let zs = tail (inits (toList $ compositeFields pdef))-                                   sql1 = map (\b -> wrapSql (T.intercalate " and " (map (\(i,a) -> sql2 (i==length b) a) (zip [1..] b)))) zs-                                   sql2 islast a = connEscapeFieldName conn (fieldDB a) <> (if islast then showSqlFilter pfilter else showSqlFilter Eq) <> "? "-                                   sqlcl = T.intercalate " or " sql1-                               in (wrapSql sqlcl, concat (tail (inits xs)))-                            (_, BackendSpecificFilter _, _) -> error "unhandled type BackendSpecificFilter for composite/non id primary keys"-                            _ -> error $ "unhandled type/filter for composite/non id primary keys pfilter=" ++ show pfilter ++ " persistList="++show allVals+                (True, Just pdef, PersistList ys : _) ->+                    let+                        cfields = toList $ compositeFields pdef+                     in+                        if length cfields /= length ys+                            then+                                error $+                                    "wrong number of entries in compositeFields vs PersistList allVals="+                                        ++ show allVals+                            else case (allVals, pfilter, isCompFilter pfilter) of+                                ([PersistList xs], Eq, _) ->+                                    let+                                        sqlcl =+                                            T.intercalate+                                                " and "+                                                ( map+                                                    (\a -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "? ")+                                                    cfields+                                                )+                                     in+                                        (wrapSql sqlcl, xs)+                                ([PersistList xs], Ne, _) ->+                                    let+                                        sqlcl =+                                            T.intercalate+                                                " or "+                                                ( map+                                                    (\a -> connEscapeFieldName conn (fieldDB a) <> showSqlFilter pfilter <> "? ")+                                                    cfields+                                                )+                                     in+                                        (wrapSql sqlcl, xs)+                                (_, In, _) ->+                                    let+                                        xxs = transpose (map fromPersistList allVals)+                                        sqls =+                                            map+                                                ( \(a, xs) ->+                                                    connEscapeFieldName conn (fieldDB a)+                                                        <> showSqlFilter pfilter+                                                        <> "("+                                                        <> T.intercalate "," (replicate (length xs) " ?")+                                                        <> ") "+                                                )+                                                (zip cfields xxs)+                                     in+                                        (wrapSql (T.intercalate " and " (map wrapSql sqls)), concat xxs)+                                (_, NotIn, _) ->+                                    let+                                        xxs = transpose (map fromPersistList allVals)+                                        sqls =+                                            map+                                                ( \(a, xs) ->+                                                    connEscapeFieldName conn (fieldDB a)+                                                        <> showSqlFilter pfilter+                                                        <> "("+                                                        <> T.intercalate "," (replicate (length xs) " ?")+                                                        <> ") "+                                                )+                                                (zip cfields xxs)+                                     in+                                        (wrapSql (T.intercalate " or " (map wrapSql sqls)), concat xxs)+                                ([PersistList xs], _, True) ->+                                    let+                                        zs = tail (inits (toList $ compositeFields pdef))+                                        sql1 =+                                            map+                                                ( \b ->+                                                    wrapSql+                                                        (T.intercalate " and " (map (\(i, a) -> sql2 (i == length b) a) (zip [1 ..] b)))+                                                )+                                                zs+                                        sql2 islast a =+                                            connEscapeFieldName conn (fieldDB a)+                                                <> (if islast then showSqlFilter pfilter else showSqlFilter Eq)+                                                <> "? "+                                        sqlcl = T.intercalate " or " sql1+                                     in+                                        (wrapSql sqlcl, concat (tail (inits xs)))+                                (_, BackendSpecificFilter _, _) ->+                                    error "unhandled type BackendSpecificFilter for composite/non id primary keys"+                                _ ->+                                    error $+                                        "unhandled type/filter for composite/non id primary keys pfilter="+                                            ++ show pfilter+                                            ++ " persistList="+                                            ++ show allVals                 (True, Just pdef, []) ->-                    error $ "empty list given as filter value filter=" ++ show pfilter ++ " persistList=" ++ show allVals ++ " pdef=" ++ show pdef+                    error $+                        "empty list given as filter value filter="+                            ++ show pfilter+                            ++ " persistList="+                            ++ show allVals+                            ++ " pdef="+                            ++ show pdef                 (True, Just pdef, _) ->-                    error $ "unhandled error for composite/non id primary keys filter=" ++ show pfilter ++ " persistList=" ++ show allVals ++ " pdef=" ++ show pdef--                _ ->   case (isNull, pfilter, length notNullVals) of-                           (True, Eq, _) -> (name <> " IS NULL", [])-                           (True, Ne, _) -> (name <> " IS NOT NULL", [])-                           (False, Ne, _) -> (T.concat-                               [ "("-                               , name-                               , " IS NULL OR "-                               , name-                               , " <> "-                               , qmarks-                               , ")"-                               ], notNullVals)-                           -- We use 1=2 (and below 1=1) to avoid using TRUE and FALSE, since-                           -- not all databases support those words directly.-                           (_, In, 0) -> ("1=2" <> orNullSuffix, [])-                           (False, In, _) -> (name <> " IN " <> qmarks <> orNullSuffix, allVals)-                           (True, In, _) -> (T.concat-                               [ "("-                               , name-                               , " IS NULL OR "-                               , name-                               , " IN "-                               , qmarks-                               , ")"-                               ], notNullVals)-                           (False, NotIn, 0) -> ("1=1", [])-                           (True, NotIn, 0) -> (name <> " IS NOT NULL", [])-                           (False, NotIn, _) -> (T.concat-                               [ "("-                               , name-                               , " IS NULL OR "-                               , name-                               , " NOT IN "-                               , qmarks-                               , ")"-                               ], notNullVals)-                           (True, NotIn, _) -> (T.concat-                               [ "("-                               , name-                               , " IS NOT NULL AND "-                               , name-                               , " NOT IN "-                               , qmarks-                               , ")"-                               ], notNullVals)-                           _ -> (name <> showSqlFilter pfilter <> "?" <> orNullSuffix, allVals)-+                    error $+                        "unhandled error for composite/non id primary keys filter="+                            ++ show pfilter+                            ++ " persistList="+                            ++ show allVals+                            ++ " pdef="+                            ++ show pdef+                _ -> case (isNull, pfilter, length notNullVals) of+                    (True, Eq, _) -> (name <> " IS NULL", [])+                    (True, Ne, _) -> (name <> " IS NOT NULL", [])+                    (False, Ne, _) ->+                        ( T.concat+                            [ "("+                            , name+                            , " IS NULL OR "+                            , name+                            , " <> "+                            , qmarks+                            , ")"+                            ]+                        , notNullVals+                        )+                    -- We use 1=2 (and below 1=1) to avoid using TRUE and FALSE, since+                    -- not all databases support those words directly.+                    (_, In, 0) -> ("1=2" <> orNullSuffix, [])+                    (False, In, _) -> (name <> " IN " <> qmarks <> orNullSuffix, allVals)+                    (True, In, _) ->+                        ( T.concat+                            [ "("+                            , name+                            , " IS NULL OR "+                            , name+                            , " IN "+                            , qmarks+                            , ")"+                            ]+                        , notNullVals+                        )+                    (False, NotIn, 0) -> ("1=1", [])+                    (True, NotIn, 0) -> (name <> " IS NOT NULL", [])+                    (False, NotIn, _) ->+                        ( T.concat+                            [ "("+                            , name+                            , " IS NULL OR "+                            , name+                            , " NOT IN "+                            , qmarks+                            , ")"+                            ]+                        , notNullVals+                        )+                    (True, NotIn, _) ->+                        ( T.concat+                            [ "("+                            , name+                            , " IS NOT NULL AND "+                            , name+                            , " NOT IN "+                            , qmarks+                            , ")"+                            ]+                        , notNullVals+                        )+                    _ -> (name <> showSqlFilter pfilter <> "?" <> orNullSuffix, allVals)       where         isCompFilter Lt = True         isCompFilter Le = True         isCompFilter Gt = True         isCompFilter Ge = True-        isCompFilter _ =  False+        isCompFilter _ = False          wrapSql sqlcl = "(" <> sqlcl <> ")"         fromPersistList (PersistList xs) = xs         fromPersistList other = error $ "expected PersistList but found " ++ show other -        filterValueToPersistValues :: forall a.  PersistField a => FilterValue a -> [PersistValue]+        filterValueToPersistValues+            :: forall a. (PersistField a) => FilterValue a -> [PersistValue]         filterValueToPersistValues = \case             FilterValue a -> [toPersistValue a]             FilterValues as -> toPersistValue <$> as@@ -400,25 +528,33 @@          orNullSuffix =             case orNull of-                OrNullYes -> mconcat [" OR "-                                      , name-                                      , " IS NULL"]+                OrNullYes ->+                    mconcat+                        [ " OR "+                        , name+                        , " IS NULL"+                        ]                 OrNullNo -> ""          isNull = PersistNull `elem` allVals         notNullVals = filter (/= PersistNull) allVals         allVals = filterValueToPersistValues value-        tn = connEscapeTableName conn $ entityDef $ dummyFromFilts [Filter field value pfilter]+        tn =+            connEscapeTableName conn $+                entityDef $+                    dummyFromFilts [Filter field value pfilter]         name = prefixByTable tablePrefix tn $ connEscapeFieldName conn (fieldName field)         qmarks = case value of-                    FilterValue{} -> "(?)"-                    UnsafeValue{} -> "(?)"-                    FilterValues xs ->-                        let parens a = "(" <> a <> ")"-                            commas = T.intercalate ","-                            toQs = fmap $ const "?"-                            nonNulls = filter (/= PersistNull) $ map toPersistValue xs-                         in parens . commas . toQs $ nonNulls+            FilterValue{} -> "(?)"+            UnsafeValue{} -> "(?)"+            FilterValues xs ->+                let+                    parens a = "(" <> a <> ")"+                    commas = T.intercalate ","+                    toQs = fmap $ const "?"+                    nonNulls = filter (/= PersistNull) $ map toPersistValue xs+                 in+                    parens . commas . toQs $ nonNulls         showSqlFilter Eq = "="         showSqlFilter Ne = "<>"         showSqlFilter Gt = ">"@@ -433,11 +569,13 @@ -- into a SQL query. -- -- @since 2.12.1.0-filterClause :: (PersistEntity val)-             => Maybe FilterTablePrefix -- ^ include table name or EXCLUDED-             -> SqlBackend-             -> [Filter val]-             -> Text+filterClause+    :: (PersistEntity val)+    => Maybe FilterTablePrefix+    -- ^ include table name or EXCLUDED+    -> SqlBackend+    -> [Filter val]+    -> Text filterClause b c = fst . filterClauseHelper b True c OrNullNo  -- |  Render a @['Filter' record]@ into a 'Text' value suitable for inclusion@@ -445,60 +583,72 @@ -- @?@ place holders. -- -- @since 2.12.1.0-filterClauseWithVals :: (PersistEntity val)-             => Maybe FilterTablePrefix -- ^ include table name or EXCLUDED-             -> SqlBackend-             -> [Filter val]-             -> (Text, [PersistValue])-filterClauseWithVals b c  = filterClauseHelper b True c OrNullNo+filterClauseWithVals+    :: (PersistEntity val)+    => Maybe FilterTablePrefix+    -- ^ include table name or EXCLUDED+    -> SqlBackend+    -> [Filter val]+    -> (Text, [PersistValue])+filterClauseWithVals b c = filterClauseHelper b True c OrNullNo  -- | Render a @['SelectOpt' record]@ made up *only* of 'Asc' and 'Desc' constructors -- into a 'Text' value suitable for inclusion into a SQL query. -- -- @since 2.13.2.0-orderClause :: (PersistEntity val)-            => Maybe FilterTablePrefix -- ^ include table name or EXCLUDED-            -> SqlBackend-            -> [SelectOpt val]-            -> Text+orderClause+    :: (PersistEntity val)+    => Maybe FilterTablePrefix+    -- ^ include table name or EXCLUDED+    -> SqlBackend+    -> [SelectOpt val]+    -> Text orderClause includeTable conn orders =     if null orders         then ""         else-            " ORDER BY " <> T.intercalate ","-                (map (\case-                    Asc  x -> name x-                    Desc x -> name x <> " DESC"-                    _ -> error "orderClause: expected Asc or Desc, not limit or offset")-                    orders)+            " ORDER BY "+                <> T.intercalate+                    ","+                    ( map+                        ( \case+                            Asc x -> name x+                            Desc x -> name x <> " DESC"+                            _ -> error "orderClause: expected Asc or Desc, not limit or offset"+                        )+                        orders+                    )   where     dummyFromOrder :: [SelectOpt a] -> Maybe a     dummyFromOrder _ = Nothing      tn = connEscapeTableName conn (entityDef $ dummyFromOrder orders) -    name :: (PersistEntity record)-         => EntityField record typ -> Text+    name+        :: (PersistEntity record)+        => EntityField record typ -> Text     name x =-        prefixByTable includeTable tn-        $ connEscapeFieldName conn (fieldName x)+        prefixByTable includeTable tn $+            connEscapeFieldName conn (fieldName x)  -- | Generates sql for limit and offset for postgres, sqlite and mysql. decorateSQLWithLimitOffset     :: Text-    -> (Int,Int)+    -> (Int, Int)     -> Text     -> Text-decorateSQLWithLimitOffset nolimit (limit,offset) sql =+decorateSQLWithLimitOffset nolimit (limit, offset) sql =     let         lim = case (limit, offset) of-                (0, 0) -> ""-                (0, _) -> T.cons ' ' nolimit-                (_, _) -> " LIMIT " <> T.pack (show limit)-        off = if offset == 0-                    then ""-                    else " OFFSET " <> T.pack (show offset)-    in mconcat+            (0, 0) -> ""+            (0, _) -> T.cons ' ' nolimit+            (_, _) -> " LIMIT " <> T.pack (show limit)+        off =+            if offset == 0+                then ""+                else " OFFSET " <> T.pack (show offset)+     in+        mconcat             [ sql             , lim             , off
Database/Persist/Sql/Orphan/PersistStore.hs view
@@ -3,12 +3,11 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE TypeOperators #-}- {-# OPTIONS_GHC -fno-warn-orphans #-}  module Database.Persist.Sql.Orphan.PersistStore     ( withRawQuery-    , BackendKey(..)+    , BackendKey (..)     , toSqlKey     , fromSqlKey     , getFieldName@@ -45,40 +44,41 @@ import Database.Persist.Sql.Types import Database.Persist.Sql.Types.Internal import Database.Persist.Sql.Util-       ( commaSeparated-       , dbIdColumns-       , keyAndEntityColumnNames-       , mkInsertValues-       , mkUpdateText-       , parseEntityValues-       , updatePersistValue-       )+    ( commaSeparated+    , dbIdColumns+    , keyAndEntityColumnNames+    , mkInsertValues+    , mkUpdateText+    , parseEntityValues+    , updatePersistValue+    ) -withRawQuery :: MonadIO m-             => Text-             -> [PersistValue]-             -> ConduitM [PersistValue] Void IO a-             -> ReaderT SqlBackend m a+withRawQuery+    :: (MonadIO m)+    => Text+    -> [PersistValue]+    -> ConduitM [PersistValue] Void IO a+    -> ReaderT SqlBackend m a withRawQuery sql vals sink = do     srcRes <- rawQueryRes sql vals     liftIO $ with srcRes (\src -> runConduit $ src .| sink) -toSqlKey :: ToBackendKey SqlBackend record => Int64 -> Key record+toSqlKey :: (ToBackendKey SqlBackend record) => Int64 -> Key record toSqlKey = fromBackendKey . SqlBackendKey -fromSqlKey :: ToBackendKey SqlBackend record => Key record -> Int64+fromSqlKey :: (ToBackendKey SqlBackend record) => Key record -> Int64 fromSqlKey = unSqlBackendKey . toBackendKey -whereStmtForKey :: PersistEntity record => SqlBackend -> Key record -> Text+whereStmtForKey :: (PersistEntity record) => SqlBackend -> Key record -> Text whereStmtForKey conn k =-    T.intercalate " AND "-  $ Foldable.toList-  $ fmap (<> "=? ")-  $ dbIdColumns conn entDef+    T.intercalate " AND " $+        Foldable.toList $+            fmap (<> "=? ") $+                dbIdColumns conn entDef   where     entDef = entityDef $ dummyFromKey k -whereStmtForKeys :: PersistEntity record => SqlBackend -> [Key record] -> Text+whereStmtForKeys :: (PersistEntity record) => SqlBackend -> [Key record] -> Text whereStmtForKeys conn ks = T.intercalate " OR " $ whereStmtForKey conn `fmap` ks  -- | get the SQL string for the table that a PersistEntity represents@@ -86,11 +86,13 @@ -- -- Your backend may provide a more convenient tableName function -- which does not operate in a Monad-getTableName :: forall record m backend.-             ( PersistEntity record-             , BackendCompatible SqlBackend backend-             , Monad m-             ) => record -> ReaderT backend m Text+getTableName+    :: forall record m backend+     . ( PersistEntity record+       , BackendCompatible SqlBackend backend+       , Monad m+       )+    => record -> ReaderT backend m Text getTableName rec = withCompatibleBackend $ do     conn <- ask     return $ connEscapeTableName conn (entityDef $ Just rec)@@ -104,36 +106,77 @@ -- -- Your backend may provide a more convenient fieldName function -- which does not operate in a Monad-getFieldName :: forall record typ m backend.-             ( PersistEntity record-             , PersistEntityBackend record ~ SqlBackend-             , BackendCompatible SqlBackend backend-             , Monad m-             )-             => EntityField record typ -> ReaderT backend m Text+getFieldName+    :: forall record typ m backend+     . ( PersistEntity record+       , PersistEntityBackend record ~ SqlBackend+       , BackendCompatible SqlBackend backend+       , Monad m+       )+    => EntityField record typ -> ReaderT backend m Text getFieldName rec = withCompatibleBackend $ do     conn <- ask     return $ connEscapeFieldName conn (fieldDB $ persistFieldDef rec)  -- | useful for a backend to implement fieldName by adding escaping-fieldDBName :: forall record typ. (PersistEntity record) => EntityField record typ -> FieldNameDB+fieldDBName+    :: forall record typ+     . (PersistEntity record) => EntityField record typ -> FieldNameDB fieldDBName = fieldDB . persistFieldDef - instance PersistCore SqlBackend where-    newtype BackendKey SqlBackend = SqlBackendKey { unSqlBackendKey :: Int64 }+    newtype BackendKey SqlBackend = SqlBackendKey {unSqlBackendKey :: Int64}         deriving stock (Show, Read, Eq, Ord, Generic)-        deriving newtype (Num, Integral, PersistField, PersistFieldSql, PathPiece, ToHttpApiData, FromHttpApiData, Real, Enum, Bounded, A.ToJSON, A.FromJSON)+        deriving newtype+            ( Num+            , Integral+            , PersistField+            , PersistFieldSql+            , PathPiece+            , ToHttpApiData+            , FromHttpApiData+            , Real+            , Enum+            , Bounded+            , A.ToJSON+            , A.FromJSON+            )  instance PersistCore SqlReadBackend where-    newtype BackendKey SqlReadBackend = SqlReadBackendKey { unSqlReadBackendKey :: Int64 }+    newtype BackendKey SqlReadBackend = SqlReadBackendKey {unSqlReadBackendKey :: Int64}         deriving stock (Show, Read, Eq, Ord, Generic)-        deriving newtype (Num, Integral, PersistField, PersistFieldSql, PathPiece, ToHttpApiData, FromHttpApiData, Real, Enum, Bounded, A.ToJSON, A.FromJSON)+        deriving newtype+            ( Num+            , Integral+            , PersistField+            , PersistFieldSql+            , PathPiece+            , ToHttpApiData+            , FromHttpApiData+            , Real+            , Enum+            , Bounded+            , A.ToJSON+            , A.FromJSON+            )  instance PersistCore SqlWriteBackend where-    newtype BackendKey SqlWriteBackend = SqlWriteBackendKey { unSqlWriteBackendKey :: Int64 }+    newtype BackendKey SqlWriteBackend = SqlWriteBackendKey {unSqlWriteBackendKey :: Int64}         deriving stock (Show, Read, Eq, Ord, Generic)-        deriving newtype (Num, Integral, PersistField, PersistFieldSql, PathPiece, ToHttpApiData, FromHttpApiData, Real, Enum, Bounded, A.ToJSON, A.FromJSON)+        deriving newtype+            ( Num+            , Integral+            , PersistField+            , PersistFieldSql+            , PathPiece+            , ToHttpApiData+            , FromHttpApiData+            , Real+            , Enum+            , Bounded+            , A.ToJSON+            , A.FromJSON+            )  instance BackendCompatible SqlBackend SqlBackend where     projectBackend = id@@ -148,22 +191,26 @@     update _ [] = return ()     update k upds = do         conn <- ask-        let wher = whereStmtForKey conn k-        let sql = T.concat-                [ "UPDATE "-                , connEscapeTableName conn (entityDef $ Just $ recordTypeFromKey k)-                , " SET "-                , T.intercalate "," $ map (mkUpdateText conn) upds-                , " WHERE "-                , wher-                ]+        let+            wher = whereStmtForKey conn k+        let+            sql =+                T.concat+                    [ "UPDATE "+                    , connEscapeTableName conn (entityDef $ Just $ recordTypeFromKey k)+                    , " SET "+                    , T.intercalate "," $ map (mkUpdateText conn) upds+                    , " WHERE "+                    , wher+                    ]         rawExecute sql $             map updatePersistValue upds `mappend` keyToValues k      insert_ val = do         conn <- ask-        let vals = mkInsertValues val-        case connInsertSql conn (entityDef (Just val)) vals  of+        let+            vals = mkInsertValues val+        case connInsertSql conn (entityDef (Just val)) vals of             ISRSingle sql -> do                 withRawQuery sql vals $ do                     pure ()@@ -174,34 +221,48 @@      insert val = do         conn <- ask-        let esql = connInsertSql conn t vals+        let+            esql = connInsertSql conn t vals         key <-             case esql of                 ISRSingle sql -> withRawQuery sql vals $ do                     x <- CL.head                     case x of                         Just [PersistInt64 i] -> case keyFromValues [PersistInt64 i] of-                            Left err -> error $ "SQL insert: keyFromValues: PersistInt64 " `mappend` show i `mappend` " " `mappend` unpack err+                            Left err ->+                                error $+                                    "SQL insert: keyFromValues: PersistInt64 "+                                        `mappend` show i+                                        `mappend` " "+                                        `mappend` unpack err                             Right k -> return k                         Nothing -> error $ "SQL insert did not return a result giving the generated ID"                         Just vals' -> case keyFromValues vals' of-                            Left e -> error $ "Invalid result from a SQL insert, got: " ++ show vals' ++ ". Error was: " ++ unpack e+                            Left e ->+                                error $+                                    "Invalid result from a SQL insert, got: "+                                        ++ show vals'+                                        ++ ". Error was: "+                                        ++ unpack e                             Right k -> return k-                 ISRInsertGet sql1 sql2 -> do                     rawExecute sql1 vals                     withRawQuery sql2 [] $ do                         mm <- CL.head-                        let m = maybe-                                  (Left $ "No results from ISRInsertGet: " `mappend` tshow (sql1, sql2))-                                  Right mm+                        let+                            m =+                                maybe+                                    (Left $ "No results from ISRInsertGet: " `mappend` tshow (sql1, sql2))+                                    Right+                                    mm                          -- TODO: figure out something better for MySQL-                        let convert x =+                        let+                            convert x =                                 case x of                                     [PersistByteString i] -> case readInteger i of -- mssql-                                                            Just (ret,"") -> [PersistInt64 $ fromIntegral ret]-                                                            _ -> x+                                        Just (ret, "") -> [PersistInt64 $ fromIntegral ret]+                                        _ -> x                                     _ -> x                             -- Yes, it's just <|>. Older bases don't have the                             -- instance for Either.@@ -214,18 +275,23 @@                 ISRManyKeys sql fs -> do                     rawExecute sql vals                     case entityPrimary t of-                       Nothing ->-                           error $ "ISRManyKeys is used when Primary is defined " ++ show sql-                       Just pdef ->-                            let pks = Foldable.toList $ fmap fieldHaskell $ compositeFields pdef-                                keyvals = map snd $ filter (\(a, _) -> let ret=isJust (find (== a) pks) in ret) $ zip (map fieldHaskell $ getEntityFields t) fs-                            in  case keyFromValues keyvals of+                        Nothing ->+                            error $ "ISRManyKeys is used when Primary is defined " ++ show sql+                        Just pdef ->+                            let+                                pks = Foldable.toList $ fmap fieldHaskell $ compositeFields pdef+                                keyvals =+                                    map snd $+                                        filter (\(a, _) -> let ret = isJust (find (== a) pks) in ret) $+                                            zip (map fieldHaskell $ getEntityFields t) fs+                             in+                                case keyFromValues keyvals of                                     Right k -> return k-                                    Left e  -> error $ "ISRManyKeys: unexpected keyvals result: " `mappend` unpack e+                                    Left e -> error $ "ISRManyKeys: unexpected keyvals result: " `mappend` unpack e          return key       where-        tshow :: Show a => a -> Text+        tshow :: (Show a) => a -> Text         tshow = T.pack . show         throw = liftIO . throwIO . userError . T.unpack         t = entityDef $ Just val@@ -241,39 +307,49 @@                 case insertManyFn ent valss of                     ISRSingle sql -> rawSql sql (concat valss)                     _ -> error "ISRSingle is expected from the connInsertManySql function"-                where-                    ent = entityDef vals-                    valss = map mkInsertValues vals+              where+                ent = entityDef vals+                valss = map mkInsertValues vals      insertMany_ vals0 = runChunked (length $ getEntityFields t) insertMany_' vals0       where         t = entityDef vals0         insertMany_' vals = do-          conn <- ask-          let valss = map mkInsertValues vals-          let sql = T.concat-                  [ "INSERT INTO "-                  , connEscapeTableName conn t-                  , "("-                  , T.intercalate "," $ map (connEscapeFieldName conn . fieldDB) $ getEntityFields t-                  , ") VALUES ("-                  , T.intercalate "),(" $ replicate (length valss) $ T.intercalate "," $ map (const "?") (getEntityFields t)-                  , ")"-                  ]-          rawExecute sql (concat valss)+            conn <- ask+            let+                valss = map mkInsertValues vals+            let+                sql =+                    T.concat+                        [ "INSERT INTO "+                        , connEscapeTableName conn t+                        , "("+                        , T.intercalate "," $ map (connEscapeFieldName conn . fieldDB) $ getEntityFields t+                        , ") VALUES ("+                        , T.intercalate "),(" $+                            replicate (length valss) $+                                T.intercalate "," $+                                    map (const "?") (getEntityFields t)+                        , ")"+                        ]+            rawExecute sql (concat valss)      replace k val = do         conn <- ask-        let t = entityDef $ Just val-        let wher = whereStmtForKey conn k-        let sql = T.concat-                [ "UPDATE "-                , connEscapeTableName conn t-                , " SET "-                , T.intercalate "," (map (go conn . fieldDB) $ getEntityFields t)-                , " WHERE "-                , wher-                ]+        let+            t = entityDef $ Just val+        let+            wher = whereStmtForKey conn k+        let+            sql =+                T.concat+                    [ "UPDATE "+                    , connEscapeTableName conn t+                    , " SET "+                    , T.intercalate "," (map (go conn . fieldDB) $ getEntityFields t)+                    , " WHERE "+                    , wher+                    ]             vals = mkInsertValues val `mappend` keyToValues k         rawExecute sql vals       where@@ -283,8 +359,10 @@      insertEntityMany es' = do         conn <- ask-        let entDef = entityDef $ map entityVal es'-        let columnNames = keyAndEntityColumnNames entDef conn+        let+            entDef = entityDef $ map entityVal es'+        let+            columnNames = keyAndEntityColumnNames entDef conn         runChunked (length columnNames) go es'       where         go = insrepHelper "INSERT"@@ -294,35 +372,41 @@     repsertMany [] = return ()     repsertMany krsDups = do         conn <- ask-        let krs = nubBy ((==) `on` fst) (reverse krsDups)-        let rs = snd `fmap` krs-        let ent = entityDef rs-        let nr  = length krs-        let toVals (k,r)-                = case entityPrimary ent of+        let+            krs = nubBy ((==) `on` fst) (reverse krsDups)+        let+            rs = snd `fmap` krs+        let+            ent = entityDef rs+        let+            nr = length krs+        let+            toVals (k, r) =+                case entityPrimary ent of                     Nothing -> keyToValues k <> (mkInsertValues r)-                    Just _  -> mkInsertValues r+                    Just _ -> mkInsertValues r         case connRepsertManySql conn of             (Just mkSql) -> rawExecute (mkSql ent nr) (concatMap toVals krs)             Nothing -> mapM_ repsert' krs               where                 repsert' (key, value) = do-                  mExisting <- get key-                  case mExisting of-                    Nothing -> insertKey key value-                    Just _ -> replace key value+                    mExisting <- get key+                    case mExisting of+                        Nothing -> insertKey key value+                        Just _ -> replace key value      delete k = do         conn <- ask         rawExecute (sql conn) (keyToValues k)       where         wher conn = whereStmtForKey conn k-        sql conn = T.concat-            [ "DELETE FROM "-            , connEscapeTableName conn (entityDef $ Just $ recordTypeFromKey k)-            , " WHERE "-            , wher conn-            ]+        sql conn =+            T.concat+                [ "DELETE FROM "+                , connEscapeTableName conn (entityDef $ Just $ recordTypeFromKey k)+                , " WHERE "+                , wher conn+                ] instance PersistStoreWrite SqlWriteBackend where     insert v = withBaseBackend $ insert v     insertMany vs = withBaseBackend $ insertMany vs@@ -341,24 +425,32 @@         return $ Map.lookup k mEs      -- inspired by Database.Persist.Sql.Orphan.PersistQuery.selectSourceRes-    getMany []      = return Map.empty-    getMany ks@(k:_)= do+    getMany [] = return Map.empty+    getMany ks@(k : _) = do         conn <- ask-        let t = entityDef . dummyFromKey $ k-        let cols = commaSeparated . Foldable.toList . keyAndEntityColumnNames t-        let wher = whereStmtForKeys conn ks-        let sql = T.concat-                [ "SELECT "-                , cols conn-                , " FROM "-                , connEscapeTableName conn t-                , " WHERE "-                , wher-                ]-        let parse vals-                = case parseEntityValues t vals of-                    Left s -> liftIO $ throwIO $-                        PersistMarshalError ("getBy: " <> s)+        let+            t = entityDef . dummyFromKey $ k+        let+            cols = commaSeparated . Foldable.toList . keyAndEntityColumnNames t+        let+            wher = whereStmtForKeys conn ks+        let+            sql =+                T.concat+                    [ "SELECT "+                    , cols conn+                    , " FROM "+                    , connEscapeTableName conn t+                    , " WHERE "+                    , wher+                    ]+        let+            parse vals =+                case parseEntityValues t vals of+                    Left s ->+                        liftIO $+                            throwIO $+                                PersistMarshalError ("getBy: " <> s)                     Right row -> return row         withRawQuery sql (Foldable.foldMap keyToValues ks) $ do             es <- CL.mapM parse .| CL.consume@@ -377,27 +469,33 @@ recordTypeFromKey :: Key record -> record recordTypeFromKey _ = error "dummyFromKey" -insrepHelper :: (MonadIO m, PersistEntity val)-             => Text-             -> [Entity val]-             -> ReaderT SqlBackend m ()-insrepHelper _       []  = return ()+insrepHelper+    :: (MonadIO m, PersistEntity val)+    => Text+    -> [Entity val]+    -> ReaderT SqlBackend m ()+insrepHelper _ [] = return () insrepHelper command es = do     conn <- ask-    let columnNames = Foldable.toList $ keyAndEntityColumnNames entDef conn+    let+        columnNames = Foldable.toList $ keyAndEntityColumnNames entDef conn     rawExecute (sql conn columnNames) vals   where     entDef = entityDef $ map entityVal es-    sql conn columnNames = T.concat-        [ command-        , " INTO "-        , connEscapeTableName conn entDef-        , "("-        , T.intercalate "," columnNames-        , ") VALUES ("-        , T.intercalate "),(" $ replicate (length es) $ T.intercalate "," $ fmap (const "?") columnNames-        , ")"-        ]+    sql conn columnNames =+        T.concat+            [ command+            , " INTO "+            , connEscapeTableName conn entDef+            , "("+            , T.intercalate "," columnNames+            , ") VALUES ("+            , T.intercalate "),(" $+                replicate (length es) $+                    T.intercalate "," $+                        fmap (const "?") columnNames+            , ")"+            ]     vals = Foldable.foldMap entityValues es  runChunked@@ -406,13 +504,16 @@     -> ([a] -> ReaderT SqlBackend m ())     -> [a]     -> ReaderT SqlBackend m ()-runChunked _ _ []     = return ()+runChunked _ _ [] = return () runChunked width m xs = do     conn <- ask     case connMaxParams conn of         Nothing -> m xs-        Just maxParams -> let chunkSize = maxParams `div` width in-            mapM_ m (chunksOf chunkSize xs)+        Just maxParams ->+            let+                chunkSize = maxParams `div` width+             in+                mapM_ m (chunksOf chunkSize xs)  -- Implement this here to avoid depending on the split package chunksOf :: Int -> [a] -> [[a]]
Database/Persist/Sql/Orphan/PersistUnique.hs view
@@ -1,9 +1,9 @@ {-# LANGUAGE ExplicitForAll #-}-{-# OPTIONS_GHC -fno-warn-orphans  #-}-module Database.Persist.Sql.Orphan.PersistUnique-  ()-  where+{-# OPTIONS_GHC -fno-warn-orphans #-} +module Database.Persist.Sql.Orphan.PersistUnique ()+where+ import Control.Exception (throwIO) import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Reader (ask)@@ -15,44 +15,52 @@  import Database.Persist import Database.Persist.Class.PersistUnique-       (defaultPutMany, defaultUpsertBy, persistUniqueKeyValues)+    ( defaultPutMany+    , defaultUpsertBy+    , persistUniqueKeyValues+    )  import Database.Persist.Sql.Orphan.PersistStore (withRawQuery) import Database.Persist.Sql.Raw import Database.Persist.Sql.Types.Internal import Database.Persist.Sql.Util-       ( dbColumns-       , mkUpdateText'-       , parseEntityValues-       , parseExistsResult-       , updatePersistValue-       )+    ( dbColumns+    , mkUpdateText'+    , parseEntityValues+    , parseExistsResult+    , updatePersistValue+    )  instance PersistUniqueWrite SqlBackend where     upsertBy uniqueKey record updates = do-      conn <- ask-      let refCol n = T.concat [connEscapeTableName conn t, ".", n]-      let mkUpdateText = mkUpdateText' (connEscapeFieldName conn) refCol-      case connUpsertSql conn of-        Just upsertSql -> case updates of-                            [] -> defaultUpsertBy uniqueKey record updates-                            _:_ -> do-                                let upds = T.intercalate "," $ map mkUpdateText updates-                                    sql = upsertSql t (persistUniqueToFieldNames uniqueKey) upds-                                    vals = map toPersistValue (toPersistFields record)-                                        ++ map updatePersistValue updates-                                        ++ unqs uniqueKey+        conn <- ask+        let+            refCol n = T.concat [connEscapeTableName conn t, ".", n]+        let+            mkUpdateText = mkUpdateText' (connEscapeFieldName conn) refCol+        case connUpsertSql conn of+            Just upsertSql -> case updates of+                [] -> defaultUpsertBy uniqueKey record updates+                _ : _ -> do+                    let+                        upds = T.intercalate "," $ map mkUpdateText updates+                        sql = upsertSql t (persistUniqueToFieldNames uniqueKey) upds+                        vals =+                            map toPersistValue (toPersistFields record)+                                ++ map updatePersistValue updates+                                ++ unqs uniqueKey -                                x <- rawSql sql vals-                                return $ head x-        Nothing -> defaultUpsertBy uniqueKey record updates-        where-          t = entityDef $ Just record-          unqs uniqueKey' = concatMap persistUniqueToValues [uniqueKey']+                    x <- rawSql sql vals+                    return $ head x+            Nothing -> defaultUpsertBy uniqueKey record updates+      where+        t = entityDef $ Just record+        unqs uniqueKey' = concatMap persistUniqueToValues [uniqueKey']      deleteBy uniq = do         conn <- ask-        let sql' = sql conn+        let+            sql' = sql conn             vals = persistUniqueToValues uniq         rawExecute sql' vals       where@@ -64,20 +72,26 @@                 [ "DELETE FROM "                 , connEscapeTableName conn t                 , " WHERE "-                , T.intercalate " AND " $ map (go' conn) $ go uniq]+                , T.intercalate " AND " $ map (go' conn) $ go uniq+                ]      putMany [] = return ()     putMany rsD = do-        let uKeys = persistUniqueKeys . head $ rsD+        let+            uKeys = persistUniqueKeys . head $ rsD         case uKeys of             [] -> insertMany_ rsD             _ -> go-        where-          go = do-            let rs = nubBy ((==) `on` persistUniqueKeyValues) (reverse rsD)-            let ent = entityDef rs-            let nr  = length rs-            let toVals r = map toPersistValue $ toPersistFields r+      where+        go = do+            let+                rs = nubBy ((==) `on` persistUniqueKeyValues) (reverse rsD)+            let+                ent = entityDef rs+            let+                nr = length rs+            let+                toVals r = map toPersistValue $ toPersistFields r             conn <- ask             case connPutManySql conn of                 (Just mkSql) -> rawExecute (mkSql ent nr) (concatMap toVals rs)@@ -91,25 +105,28 @@ instance PersistUniqueRead SqlBackend where     getBy uniq = do         conn <- ask-        let sql =+        let+            sql =                 T.concat                     [ "SELECT "                     , T.intercalate "," $ toList $ dbColumns conn t                     , " FROM "                     , connEscapeTableName conn t                     , " WHERE "-                    , sqlClause conn]+                    , sqlClause conn+                    ]             uvals = persistUniqueToValues uniq         withRawQuery sql uvals $-            do row <- CL.head-               case row of-                   Nothing -> return Nothing-                   Just [] -> error "getBy: empty row"-                   Just vals ->-                       case parseEntityValues t vals of-                           Left err ->-                               liftIO $ throwIO $ PersistMarshalError err-                           Right r -> return $ Just r+            do+                row <- CL.head+                case row of+                    Nothing -> return Nothing+                    Just [] -> error "getBy: empty row"+                    Just vals ->+                        case parseEntityValues t vals of+                            Left err ->+                                liftIO $ throwIO $ PersistMarshalError err+                            Right r -> return $ Just r       where         sqlClause conn =             T.intercalate " AND " $ map (go conn) $ toFieldNames' uniq@@ -119,7 +136,8 @@      existsBy uniq = do         conn <- ask-        let sql =+        let+            sql =                 T.concat                     [ "SELECT EXISTS(SELECT 1 FROM "                     , connEscapeTableName conn t
Database/Persist/Sql/Raw.hs view
@@ -19,10 +19,11 @@ import Database.Persist.Sql.Types.Internal import Database.Persist.SqlBackend.Internal.StatementCache -rawQuery :: (MonadResource m, MonadReader env m, BackendCompatible SqlBackend env)-         => Text-         -> [PersistValue]-         -> ConduitM () [PersistValue] m ()+rawQuery+    :: (MonadResource m, MonadReader env m, BackendCompatible SqlBackend env)+    => Text+    -> [PersistValue]+    -> ConduitM () [PersistValue] m () rawQuery sql vals = do     srcRes <- liftPersist $ rawQueryRes sql vals     (releaseKey, src) <- allocateAcquire srcRes@@ -36,8 +37,10 @@     -> ReaderT env m1 (Acquire (ConduitM () [PersistValue] m2 ())) rawQueryRes sql vals = do     conn <- projectBackend `liftM` ask-    let make = do-            runLoggingT (logDebugNS (pack "SQL") $ T.append sql $ pack $ "; " ++ show vals)+    let+        make = do+            runLoggingT+                (logDebugNS (pack "SQL") $ T.append sql $ pack $ "; " ++ show vals)                 (connLogFunc conn)             getStmtConn conn sql     return $ do@@ -45,21 +48,28 @@         stmtQuery stmt vals  -- | Execute a raw SQL statement-rawExecute :: (MonadIO m, BackendCompatible SqlBackend backend)-           => Text            -- ^ SQL statement, possibly with placeholders.-           -> [PersistValue]  -- ^ Values to fill the placeholders.-           -> ReaderT backend m ()+rawExecute+    :: (MonadIO m, BackendCompatible SqlBackend backend)+    => Text+    -- ^ SQL statement, possibly with placeholders.+    -> [PersistValue]+    -- ^ Values to fill the placeholders.+    -> ReaderT backend m () rawExecute x y = liftM (const ()) $ rawExecuteCount x y  -- | Execute a raw SQL statement and return the number of -- rows it has modified.-rawExecuteCount :: (MonadIO m, BackendCompatible SqlBackend backend)-                => Text            -- ^ SQL statement, possibly with placeholders.-                -> [PersistValue]  -- ^ Values to fill the placeholders.-                -> ReaderT backend m Int64+rawExecuteCount+    :: (MonadIO m, BackendCompatible SqlBackend backend)+    => Text+    -- ^ SQL statement, possibly with placeholders.+    -> [PersistValue]+    -- ^ Values to fill the placeholders.+    -> ReaderT backend m Int64 rawExecuteCount sql vals = do     conn <- projectBackend `liftM` ask-    runLoggingT (logDebugNS (pack "SQL") $ T.append sql $ pack $ "; " ++ show vals)+    runLoggingT+        (logDebugNS (pack "SQL") $ T.append sql $ pack $ "; " ++ show vals)         (connLogFunc conn)     stmt <- getStmt sql     res <- liftIO $ stmtExecute stmt vals@@ -67,40 +77,44 @@     return res  getStmt-  :: (MonadIO m, MonadReader backend m, BackendCompatible SqlBackend backend)-  => Text -> m Statement+    :: (MonadIO m, MonadReader backend m, BackendCompatible SqlBackend backend)+    => Text -> m Statement getStmt sql = do     conn <- projectBackend `liftM` ask     liftIO $ getStmtConn conn sql  getStmtConn :: SqlBackend -> Text -> IO Statement getStmtConn conn sql = do-    let cacheK = mkCacheKeyFromQuery sql+    let+        cacheK = mkCacheKeyFromQuery sql     mstmt <- statementCacheLookup (connStmtMap conn) cacheK     stmt <- case mstmt of         Just stmt -> pure stmt         Nothing -> do             stmt' <- liftIO $ connPrepare conn sql             iactive <- liftIO $ newIORef True-            let stmt = Statement-                    { stmtFinalize = do-                        active <- readIORef iactive-                        when active $ do stmtFinalize stmt'-                                         writeIORef iactive False-                    , stmtReset = do-                        active <- readIORef iactive-                        when active $ stmtReset stmt'-                    , stmtExecute = \x -> do-                        active <- readIORef iactive-                        if active-                            then stmtExecute stmt' x-                            else throwIO $ StatementAlreadyFinalized sql-                    , stmtQuery = \x -> do-                        active <- liftIO $ readIORef iactive-                        if active-                            then stmtQuery stmt' x-                            else liftIO $ throwIO $ StatementAlreadyFinalized sql-                    }+            let+                stmt =+                    Statement+                        { stmtFinalize = do+                            active <- readIORef iactive+                            when active $ do+                                stmtFinalize stmt'+                                writeIORef iactive False+                        , stmtReset = do+                            active <- readIORef iactive+                            when active $ stmtReset stmt'+                        , stmtExecute = \x -> do+                            active <- readIORef iactive+                            if active+                                then stmtExecute stmt' x+                                else throwIO $ StatementAlreadyFinalized sql+                        , stmtQuery = \x -> do+                            active <- liftIO $ readIORef iactive+                            if active+                                then stmtQuery stmt' x+                                else liftIO $ throwIO $ StatementAlreadyFinalized sql+                        }              liftIO $ statementCacheInsert (connStmtMap conn) cacheK stmt             pure stmt@@ -202,57 +216,69 @@ -- >          xs <- getPerson -- >          liftIO (print xs) -- >--rawSql :: (RawSql a, MonadIO m, BackendCompatible SqlBackend backend)-       => Text             -- ^ SQL statement, possibly with placeholders.-       -> [PersistValue]   -- ^ Values to fill the placeholders.-       -> ReaderT backend m [a]+rawSql+    :: (RawSql a, MonadIO m, BackendCompatible SqlBackend backend)+    => Text+    -- ^ SQL statement, possibly with placeholders.+    -> [PersistValue]+    -- ^ Values to fill the placeholders.+    -> ReaderT backend m [a] rawSql stmt = run-    where-      getType :: (x -> m [a]) -> a-      getType = error "rawSql.getType"+  where+    getType :: (x -> m [a]) -> a+    getType = error "rawSql.getType" -      x = getType run-      process = rawSqlProcessRow+    x = getType run+    process = rawSqlProcessRow -      withStmt' colSubsts params sink = do-            srcRes <- rawQueryRes sql params-            liftIO $ with srcRes (\src -> runConduit $ src .| sink)+    withStmt' colSubsts params sink = do+        srcRes <- rawQueryRes sql params+        liftIO $ with srcRes (\src -> runConduit $ src .| sink)+      where+        sql = T.concat $ makeSubsts colSubsts $ T.splitOn placeholder stmt+        placeholder = "??"+        makeSubsts (s : ss) (t : ts) = t : s : makeSubsts ss ts+        makeSubsts [] [] = []+        makeSubsts [] ts = [T.intercalate placeholder ts]+        makeSubsts ss [] = error (concat err)           where-            sql = T.concat $ makeSubsts colSubsts $ T.splitOn placeholder stmt-            placeholder = "??"-            makeSubsts (s:ss) (t:ts) = t : s : makeSubsts ss ts-            makeSubsts []     []     = []-            makeSubsts []     ts     = [T.intercalate placeholder ts]-            makeSubsts ss     []     = error (concat err)-                where-                  err = [ "rawsql: there are still ", show (length ss)-                        , "'??' placeholder substitutions to be made "-                        , "but all '??' placeholders have already been "-                        , "consumed.  Please read 'rawSql's documentation "-                        , "on how '??' placeholders work."-                        ]+            err =+                [ "rawsql: there are still "+                , show (length ss)+                , "'??' placeholder substitutions to be made "+                , "but all '??' placeholders have already been "+                , "consumed.  Please read 'rawSql's documentation "+                , "on how '??' placeholders work."+                ] -      run params = do+    run params = do         conn <- projectBackend `liftM` ask-        let (colCount, colSubsts) = rawSqlCols (connEscapeRawName conn) x+        let+            (colCount, colSubsts) = rawSqlCols (connEscapeRawName conn) x         withStmt' colSubsts params $ firstRow colCount -      firstRow colCount = do+    firstRow colCount = do         mrow <- await         case mrow of-          Nothing -> return []-          Just row-              | colCount == length row -> getter mrow-              | otherwise              -> fail $ concat-                  [ "rawSql: wrong number of columns, got "-                  , show (length row), " but expected ", show colCount-                  , " (", rawSqlColCountReason x, ")." ]+            Nothing -> return []+            Just row+                | colCount == length row -> getter mrow+                | otherwise ->+                    fail $+                        concat+                            [ "rawSql: wrong number of columns, got "+                            , show (length row)+                            , " but expected "+                            , show colCount+                            , " ("+                            , rawSqlColCountReason x+                            , ")."+                            ] -      getter = go id-          where-            go acc Nothing = return (acc [])-            go acc (Just row) =-              case process row of+    getter = go id+      where+        go acc Nothing = return (acc [])+        go acc (Just row) =+            case process row of                 Left err -> fail (T.unpack err)-                Right r  -> await >>= go (acc . (r:))+                Right r -> await >>= go (acc . (r :))
Database/Persist/Sql/Run.hs view
@@ -1,16 +1,17 @@-{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}+ module Database.Persist.Sql.Run where +import Control.Monad (void) import Control.Monad.IO.Unlift import Control.Monad.Logger.CallStack-import Control.Monad (void) import Control.Monad.Reader (MonadReader) import qualified Control.Monad.Reader as MonadReader import Control.Monad.Trans.Reader hiding (local) import Control.Monad.Trans.Resource-import Data.Acquire (Acquire, ReleaseType(..), mkAcquireType, with)+import Data.Acquire (Acquire, ReleaseType (..), mkAcquireType, with) import Data.Pool as P import qualified Data.Text as T import qualified UnliftIO.Exception as UE@@ -19,8 +20,8 @@ import Database.Persist.Sql.Raw import Database.Persist.Sql.Types import Database.Persist.Sql.Types.Internal-import Database.Persist.SqlBackend.Internal.StatementCache import Database.Persist.SqlBackend.Internal.SqlPoolHooks+import Database.Persist.SqlBackend.Internal.StatementCache  -- | Get a connection from the pool, run the given action, and then return the -- connection to the pool.@@ -32,7 +33,8 @@ -- was buggy and caused more problems than it solved. Since version 2.1.2, it -- performs no timeout checks. runSqlPool-    :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a -> Pool backend -> m a runSqlPool r pconn = do     rawRunSqlPool r pconn Nothing@@ -41,7 +43,8 @@ -- -- @since 2.9.0 runSqlPoolWithIsolation-    :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a -> Pool backend -> IsolationLevel -> m a runSqlPoolWithIsolation r pconn i =     rawRunSqlPool r pconn (Just i)@@ -51,28 +54,36 @@ -- -- @since 2.12.0.0 runSqlPoolNoTransaction-    :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> m a runSqlPoolNoTransaction r pconn i =     runSqlPoolWithHooks r pconn i (\_ -> pure ()) (\_ -> pure ()) (\_ _ -> pure ())  rawRunSqlPool-    :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a -> Pool backend -> Maybe IsolationLevel -> m a rawRunSqlPool r pconn mi =     runSqlPoolWithHooks r pconn mi before after onException   where     before conn = do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend+        let+            sqlBackend = projectBackend conn+        let+            getter = getStmtConn sqlBackend         liftIO $ connBegin sqlBackend getter mi     after conn = do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend+        let+            sqlBackend = projectBackend conn+        let+            getter = getStmtConn sqlBackend         liftIO $ connCommit sqlBackend getter     onException conn _ = do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend+        let+            sqlBackend = projectBackend conn+        let+            getter = getStmtConn sqlBackend         liftIO $ connRollback sqlBackend getter  -- | This function is how 'runSqlPool' and 'runSqlPoolNoTransaction' are@@ -82,7 +93,8 @@ -- -- @since 2.12.0.0 runSqlPoolWithHooks-    :: forall backend m a before after onException. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a before after onException+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a     -> Pool backend     -> Maybe IsolationLevel@@ -96,12 +108,13 @@     -- cleanup function is complete.     -> m a runSqlPoolWithHooks r pconn i before after onException =-    runSqlPoolWithExtensibleHooks r pconn i $ SqlPoolHooks-        { alterBackend = pure-        , runBefore = \conn _ -> void $ before conn-        , runAfter = \conn _ -> void $ after conn-        , runOnException = \b _ e -> void $ onException b e-        }+    runSqlPoolWithExtensibleHooks r pconn i $+        SqlPoolHooks+            { alterBackend = pure+            , runBefore = \conn _ -> void $ before conn+            , runAfter = \conn _ -> void $ after conn+            , runOnException = \b _ e -> void $ onException b e+            }  -- | This function is how 'runSqlPoolWithHooks' is defined. --@@ -109,7 +122,8 @@ -- -- @since 2.13.0.0 runSqlPoolWithExtensibleHooks-    :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)     => ReaderT backend m a     -> Pool backend     -> Maybe IsolationLevel@@ -117,16 +131,17 @@     -> m a runSqlPoolWithExtensibleHooks r pconn i SqlPoolHooks{..} =     withRunInIO $ \runInIO ->-    withResource pconn $ \conn ->-    UE.mask $ \restore -> do-        conn' <- restore $ runInIO $ alterBackend conn-        _ <- restore $ runInIO $ runBefore conn' i-        a <- restore (runInIO (runReaderT r conn'))-            `UE.catchAny` \e -> do-                _ <- restore $ runInIO $ runOnException conn' i e-                UE.throwIO e-        _ <- restore $ runInIO $ runAfter conn' i-        pure a+        withResource pconn $ \conn ->+            UE.mask $ \restore -> do+                conn' <- restore $ runInIO $ alterBackend conn+                _ <- restore $ runInIO $ runBefore conn' i+                a <-+                    restore (runInIO (runReaderT r conn'))+                        `UE.catchAny` \e -> do+                            _ <- restore $ runInIO $ runOnException conn' i e+                            UE.throwIO e+                _ <- restore $ runInIO $ runAfter conn' i+                pure a  rawAcquireSqlConn     :: forall backend m@@ -134,7 +149,8 @@     => Maybe IsolationLevel -> m (Acquire backend) rawAcquireSqlConn isolation = do     conn <- MonadReader.ask-    let rawConn :: SqlBackend+    let+        rawConn :: SqlBackend         rawConn = projectBackend conn          getter :: T.Text -> IO Statement@@ -176,15 +192,21 @@     => IsolationLevel -> m (Acquire backend) acquireSqlConnWithIsolation = rawAcquireSqlConn . Just -runSqlConn :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> m a+runSqlConn+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    => ReaderT backend m a -> backend -> m a runSqlConn r conn = with (acquireSqlConn conn) $ runReaderT r  -- | Like 'runSqlConn', but supports specifying an isolation level. -- -- @since 2.9.0-runSqlConnWithIsolation :: forall backend m a. (MonadUnliftIO m, BackendCompatible SqlBackend backend) => ReaderT backend m a -> backend -> IsolationLevel -> m a+runSqlConnWithIsolation+    :: forall backend m a+     . (MonadUnliftIO m, BackendCompatible SqlBackend backend)+    => ReaderT backend m a -> backend -> IsolationLevel -> m a runSqlConnWithIsolation r conn isolation =-  with (acquireSqlConnWithIsolation isolation conn) $ runReaderT r+    with (acquireSqlConnWithIsolation isolation conn) $ runReaderT r  runSqlPersistM     :: (BackendCompatible SqlBackend backend)@@ -197,64 +219,84 @@ runSqlPersistMPool x pool = runResourceT $ runNoLoggingT $ runSqlPool x pool  liftSqlPersistMPool-    :: forall backend m a. (MonadIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadIO m, BackendCompatible SqlBackend backend)     => ReaderT backend (NoLoggingT (ResourceT IO)) a -> Pool backend -> m a liftSqlPersistMPool x pool = liftIO (runSqlPersistMPool x pool)  withSqlPool-    :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)-    => (LogFunc -> IO backend) -- ^ create a new connection-    -> Int -- ^ connection count+    :: forall backend m a+     . (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)+    => (LogFunc -> IO backend)+    -- ^ create a new connection+    -> Int+    -- ^ connection count     -> (Pool backend -> m a)     -> m a-withSqlPool mkConn connCount f = withSqlPoolWithConfig mkConn (defaultConnectionPoolConfig { connectionPoolConfigSize = connCount } ) f+withSqlPool mkConn connCount f =+    withSqlPoolWithConfig+        mkConn+        (defaultConnectionPoolConfig{connectionPoolConfigSize = connCount})+        f  -- | Creates a pool of connections to a SQL database which can be used by the @Pool backend -> m a@ function. -- After the function completes, the connections are destroyed. -- -- @since 2.11.0.0 withSqlPoolWithConfig-    :: forall backend m a. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)-    => (LogFunc -> IO backend) -- ^ Function to create a new connection+    :: forall backend m a+     . (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)+    => (LogFunc -> IO backend)+    -- ^ Function to create a new connection     -> ConnectionPoolConfig     -> (Pool backend -> m a)     -> m a-withSqlPoolWithConfig mkConn poolConfig f = withUnliftIO $ \u -> UE.bracket-    (unliftIO u $ createSqlPoolWithConfig mkConn poolConfig)-    destroyAllResources-    (unliftIO u . f)+withSqlPoolWithConfig mkConn poolConfig f = withUnliftIO $ \u ->+    UE.bracket+        (unliftIO u $ createSqlPoolWithConfig mkConn poolConfig)+        destroyAllResources+        (unliftIO u . f)  createSqlPool-    :: forall backend m. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)+    :: forall backend m+     . (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)     => (LogFunc -> IO backend)     -> Int     -> m (Pool backend)-createSqlPool mkConn size = createSqlPoolWithConfig mkConn (defaultConnectionPoolConfig { connectionPoolConfigSize = size } )+createSqlPool mkConn size =+    createSqlPoolWithConfig+        mkConn+        (defaultConnectionPoolConfig{connectionPoolConfigSize = size})  -- | Creates a pool of connections to a SQL database. -- -- @since 2.11.0.0 createSqlPoolWithConfig-    :: forall m backend. (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)-    => (LogFunc -> IO backend) -- ^ Function to create a new connection+    :: forall m backend+     . (MonadLoggerIO m, MonadUnliftIO m, BackendCompatible SqlBackend backend)+    => (LogFunc -> IO backend)+    -- ^ Function to create a new connection     -> ConnectionPoolConfig     -> m (Pool backend) createSqlPoolWithConfig mkConn config = do     logFunc <- askLoggerIO     -- Resource pool will swallow any exceptions from close. We want to log     -- them instead.-    let loggedClose :: backend -> IO ()-        loggedClose backend = close' backend `UE.catchAny` \e -> do-            runLoggingT-              (logError $ T.pack $ "Error closing database connection in pool: " ++ show e)-              logFunc-            UE.throwIO e-    liftIO $ createPool-        (mkConn logFunc)-        loggedClose-        (connectionPoolConfigStripes config)-        (connectionPoolConfigIdleTimeout config)-        (connectionPoolConfigSize config)+    let+        loggedClose :: backend -> IO ()+        loggedClose backend =+            close' backend `UE.catchAny` \e -> do+                runLoggingT+                    (logError $ T.pack $ "Error closing database connection in pool: " ++ show e)+                    logFunc+                UE.throwIO e+    liftIO $+        createPool+            (mkConn logFunc)+            loggedClose+            (connectionPoolConfigStripes config)+            (connectionPoolConfigIdleTimeout config)+            (connectionPoolConfigSize config)  -- | Create a connection and run sql queries within it. This function -- automatically closes the connection on it's completion.@@ -306,20 +348,21 @@ -- -- > Migrating: CREATE TABLE "person"("id" INTEGER PRIMARY KEY,"name" VARCHAR NOT NULL,"age" INTEGER NULL) -- > [Entity {entityKey = PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 1}}, entityVal = Person {personName = "John doe", personAge = Just 35}},Entity {entityKey = PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 2}}, entityVal = Person {personName = "Hema", personAge = Just 36}}]---- withSqlConn-    :: forall backend m a. (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend)+    :: forall backend m a+     . (MonadUnliftIO m, MonadLoggerIO m, BackendCompatible SqlBackend backend)     => (LogFunc -> IO backend) -> (backend -> m a) -> m a withSqlConn open f = do     logFunc <- askLoggerIO-    withRunInIO $ \run -> UE.bracket-      (open logFunc)-      close'-      (run . f)+    withRunInIO $ \run ->+        UE.bracket+            (open logFunc)+            close'+            (run . f)  close' :: (BackendCompatible SqlBackend backend) => backend -> IO () close' conn = do-    let backend = projectBackend conn+    let+        backend = projectBackend conn     statementCacheClear $ connStmtMap backend     connClose backend
Database/Persist/Sql/Types.hs view
@@ -1,16 +1,26 @@ module Database.Persist.Sql.Types     ( module Database.Persist.Sql.Types-    , SqlBackend, SqlReadBackend (..), SqlWriteBackend (..)-    , Statement (..), LogFunc, InsertSqlResult (..)-    , readToUnknown, readToWrite, writeToUnknown-    , SqlBackendCanRead, SqlBackendCanWrite, SqlReadT, SqlWriteT, IsSqlBackend-    , OverflowNatural(..)-    , ConnectionPoolConfig(..)+    , SqlBackend+    , SqlReadBackend (..)+    , SqlWriteBackend (..)+    , Statement (..)+    , LogFunc+    , InsertSqlResult (..)+    , readToUnknown+    , readToWrite+    , writeToUnknown+    , SqlBackendCanRead+    , SqlBackendCanWrite+    , SqlReadT+    , SqlWriteT+    , IsSqlBackend+    , OverflowNatural (..)+    , ConnectionPoolConfig (..)     ) where -import Control.Exception (Exception(..))+import Control.Exception (Exception (..)) import Control.Monad.Logger (NoLoggingT)-import Control.Monad.Trans.Reader (ReaderT(..))+import Control.Monad.Trans.Reader (ReaderT (..)) import Control.Monad.Trans.Resource (ResourceT) import Data.Pool (Pool) import Data.Text (Text)@@ -20,13 +30,13 @@ import Database.Persist.Types  data Column = Column-    { cName      :: !FieldNameDB-    , cNull      :: !Bool-    , cSqlType   :: !SqlType-    , cDefault   :: !(Maybe Text)+    { cName :: !FieldNameDB+    , cNull :: !Bool+    , cSqlType :: !SqlType+    , cDefault :: !(Maybe Text)     , cGenerated :: !(Maybe Text)-    , cDefaultConstraintName   :: !(Maybe ConstraintNameDB)-    , cMaxLen    :: !(Maybe Integer)+    , cDefaultConstraintName :: !(Maybe ConstraintNameDB)+    , cMaxLen :: !(Maybe Integer)     , cReference :: !(Maybe ColumnReference)     }     deriving (Eq, Ord, Show)@@ -51,9 +61,10 @@     }     deriving (Eq, Ord, Show) -data PersistentSqlException = StatementAlreadyFinalized Text-                            | Couldn'tGetSQLConnection-    deriving Show+data PersistentSqlException+    = StatementAlreadyFinalized Text+    | Couldn'tGetSQLConnection+    deriving (Show) instance Exception PersistentSqlException  type SqlPersistT = ReaderT SqlBackend@@ -66,13 +77,17 @@ -- -- @since 2.11.0.0 data ConnectionPoolConfig = ConnectionPoolConfig-    { connectionPoolConfigStripes :: Int -- ^ How many stripes to divide the pool into. See "Data.Pool" for details. Default: 1.-    , connectionPoolConfigIdleTimeout :: NominalDiffTime -- ^ How long connections can remain idle before being disposed of, in seconds. Default: 600-    , connectionPoolConfigSize :: Int -- ^ How many connections should be held in the connection pool. Default: 10+    { connectionPoolConfigStripes :: Int+    -- ^ How many stripes to divide the pool into. See "Data.Pool" for details. Default: 1.+    , connectionPoolConfigIdleTimeout :: NominalDiffTime+    -- ^ How long connections can remain idle before being disposed of, in seconds. Default: 600+    , connectionPoolConfigSize :: Int+    -- ^ How many connections should be held in the connection pool. Default: 10     }     deriving (Show)  -- TODO: Bad defaults for SQLite maybe?+ -- | Initializes a ConnectionPoolConfig with default values. See the documentation of 'ConnectionPoolConfig' for each field's default value. -- -- @since 2.11.0.0@@ -131,10 +146,8 @@ -- Note that 'rawSql' knows how to replace the double question -- marks @??@ because of the type of the @results@. - -- | A single column (see 'rawSql').  Any 'PersistField' may be -- used here, including 'PersistValue' (which does not do any -- processing). newtype Single a = Single {unSingle :: a}     deriving (Eq, Ord, Show, Read)-
Database/Persist/Sql/Types/Internal.hs view
@@ -33,16 +33,16 @@ import Control.Monad.Trans.Reader (ReaderT, ask, runReaderT)  import Database.Persist.Class-       ( BackendCompatible(..)-       , HasPersistBackend(..)-       , PersistQueryRead-       , PersistQueryWrite-       , PersistStoreRead-       , PersistStoreWrite-       , PersistUniqueRead-       , PersistUniqueWrite-       )-import Database.Persist.Class.PersistStore (IsPersistBackend(..))+    ( BackendCompatible (..)+    , HasPersistBackend (..)+    , PersistQueryRead+    , PersistQueryWrite+    , PersistStoreRead+    , PersistStoreWrite+    , PersistUniqueRead+    , PersistUniqueWrite+    )+import Database.Persist.Class.PersistStore (IsPersistBackend (..)) import Database.Persist.SqlBackend.Internal import Database.Persist.SqlBackend.Internal.InsertSqlResult import Database.Persist.SqlBackend.Internal.IsolationLevel@@ -52,7 +52,7 @@ -- | An SQL backend which can only handle read queries -- -- The constructor was exposed in 2.10.0.-newtype SqlReadBackend = SqlReadBackend { unSqlReadBackend :: SqlBackend }+newtype SqlReadBackend = SqlReadBackend {unSqlReadBackend :: SqlBackend}  instance HasPersistBackend SqlReadBackend where     type BaseBackend SqlReadBackend = SqlBackend@@ -64,7 +64,7 @@ -- | An SQL backend which can handle read or write queries -- -- The constructor was exposed in 2.10.0-newtype SqlWriteBackend = SqlWriteBackend { unSqlWriteBackend :: SqlBackend }+newtype SqlWriteBackend = SqlWriteBackend {unSqlWriteBackend :: SqlBackend}  instance HasPersistBackend SqlWriteBackend where     type BaseBackend SqlWriteBackend = SqlBackend@@ -74,40 +74,49 @@     mkPersistBackend = SqlWriteBackend  -- | Useful for running a write query against an untagged backend with unknown capabilities.-writeToUnknown :: Monad m => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a+writeToUnknown+    :: (Monad m) => ReaderT SqlWriteBackend m a -> ReaderT SqlBackend m a writeToUnknown ma = do-  unknown <- ask-  lift . runReaderT ma $ SqlWriteBackend unknown+    unknown <- ask+    lift . runReaderT ma $ SqlWriteBackend unknown  -- | Useful for running a read query against a backend with read and write capabilities.-readToWrite :: Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a+readToWrite+    :: (Monad m) => ReaderT SqlReadBackend m a -> ReaderT SqlWriteBackend m a readToWrite ma = do-  write <- ask-  lift . runReaderT ma . SqlReadBackend $ unSqlWriteBackend write+    write <- ask+    lift . runReaderT ma . SqlReadBackend $ unSqlWriteBackend write  -- | Useful for running a read query against a backend with unknown capabilities.-readToUnknown :: Monad m => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a+readToUnknown+    :: (Monad m) => ReaderT SqlReadBackend m a -> ReaderT SqlBackend m a readToUnknown ma = do-  unknown <- ask-  lift . runReaderT ma $ SqlReadBackend unknown+    unknown <- ask+    lift . runReaderT ma $ SqlReadBackend unknown  -- | A constraint synonym which witnesses that a backend is SQL and can run read queries. type SqlBackendCanRead backend =     ( BackendCompatible SqlBackend backend-    , PersistQueryRead backend, PersistStoreRead backend, PersistUniqueRead backend+    , PersistQueryRead backend+    , PersistStoreRead backend+    , PersistUniqueRead backend     )  -- | A constraint synonym which witnesses that a backend is SQL and can run read and write queries. type SqlBackendCanWrite backend =     ( SqlBackendCanRead backend-    , PersistQueryWrite backend, PersistStoreWrite backend, PersistUniqueWrite backend+    , PersistQueryWrite backend+    , PersistStoreWrite backend+    , PersistUniqueWrite backend     )  -- | Like @SqlPersistT@ but compatible with any SQL backend which can handle read queries.-type SqlReadT m a = forall backend. (SqlBackendCanRead backend) => ReaderT backend m a+type SqlReadT m a =+    forall backend. (SqlBackendCanRead backend) => ReaderT backend m a  -- | Like @SqlPersistT@ but compatible with any SQL backend which can handle read and write queries.-type SqlWriteT m a = forall backend. (SqlBackendCanWrite backend) => ReaderT backend m a+type SqlWriteT m a =+    forall backend. (SqlBackendCanWrite backend) => ReaderT backend m a  -- | A backend which is a wrapper around @SqlBackend@. type IsSqlBackend backend =
Database/Persist/Sql/Util.hs view
@@ -23,44 +23,45 @@  import Data.ByteString.Char8 (readInteger) import Data.Int (Int64)-import Data.List.NonEmpty (NonEmpty(..))+import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.Maybe as Maybe import Data.Text (Text, pack) import qualified Data.Text as T  import Database.Persist-       ( Entity(Entity)-       , EntityDef-       , EntityField-       , FieldDef(..)-       , FieldNameDB-       , FieldNameHS(FieldNameHS)-       , PersistEntity(..)-       , PersistUpdate(..)-       , PersistValue(..)-       , Update(..)-       , compositeFields-       , entityPrimary-       , fieldDB-       , fieldHaskell-       , fromPersistValues-       , getEntityFields-       , getEntityKeyFields-       , keyAndEntityFields-       , keyFromValues-       , persistFieldDef-       , toPersistValue-       )+    ( Entity (Entity)+    , EntityDef+    , EntityField+    , FieldDef (..)+    , FieldNameDB+    , FieldNameHS (FieldNameHS)+    , PersistEntity (..)+    , PersistUpdate (..)+    , PersistValue (..)+    , Update (..)+    , compositeFields+    , entityPrimary+    , fieldDB+    , fieldHaskell+    , fromPersistValues+    , getEntityFields+    , getEntityKeyFields+    , keyAndEntityFields+    , keyFromValues+    , persistFieldDef+    , toPersistValue+    ) -import Database.Persist.SqlBackend.Internal (SqlBackend(..))+import Database.Persist.SqlBackend.Internal (SqlBackend (..))  keyAndEntityColumnNames :: EntityDef -> SqlBackend -> NonEmpty Text keyAndEntityColumnNames ent conn =     fmap (connEscapeFieldName conn . fieldDB) (keyAndEntityFields ent)  entityColumnCount :: EntityDef -> Int-entityColumnCount e = length (getEntityFields e)-                    + if hasNaturalKey e then 0 else 1+entityColumnCount e =+    length (getEntityFields e)+        + if hasNaturalKey e then 0 else 1  -- | Returns 'True' if the entity has a natural key defined with the -- Primary keyword.@@ -163,47 +164,52 @@   where     escapeColumn = connEscapeFieldName conn . fieldDB -parseEntityValues :: PersistEntity record-                  => EntityDef -> [PersistValue] -> Either Text (Entity record)+parseEntityValues+    :: (PersistEntity record)+    => EntityDef -> [PersistValue] -> Either Text (Entity record) parseEntityValues t vals =     case entityPrimary t of-      Just pdef ->-            let pks = fmap fieldHaskell $ compositeFields pdef-                keyvals = map snd . filter ((`elem` pks) . fst)-                        $ zip (map fieldHaskell $ getEntityFields t) vals-            in fromPersistValuesComposite' keyvals vals-      Nothing -> fromPersistValues' vals+        Just pdef ->+            let+                pks = fmap fieldHaskell $ compositeFields pdef+                keyvals =+                    map snd . filter ((`elem` pks) . fst) $+                        zip (map fieldHaskell $ getEntityFields t) vals+             in+                fromPersistValuesComposite' keyvals vals+        Nothing -> fromPersistValues' vals   where-    fromPersistValues' (kpv:xs) = -- oracle returns Double+    fromPersistValues' (kpv : xs) =+        -- oracle returns Double         case fromPersistValues xs of             Left e -> Left e             Right xs' ->                 case keyFromValues [kpv] of                     Left _ -> error $ "fromPersistValues': keyFromValues failed on " ++ show kpv                     Right k -> Right (Entity k xs')--     fromPersistValues' xs = Left $ pack ("error in fromPersistValues' xs=" ++ show xs)      fromPersistValuesComposite' keyvals xs =         case fromPersistValues xs of             Left e -> Left e             Right xs' -> case keyFromValues keyvals of-                Left err -> error $ "fromPersistValuesComposite': keyFromValues failed with error: "-                    <> T.unpack err+                Left err ->+                    error $+                        "fromPersistValuesComposite': keyFromValues failed with error: "+                            <> T.unpack err                 Right key -> Right (Entity key xs') - isIdField-    :: forall record typ. (PersistEntity record)+    :: forall record typ+     . (PersistEntity record)     => EntityField record typ     -> Bool isIdField f = fieldHaskell (persistFieldDef f) == FieldNameHS "Id"  -- | Gets the 'FieldDef' for an 'Update'.-updateFieldDef :: PersistEntity v => Update v -> FieldDef+updateFieldDef :: (PersistEntity v) => Update v -> FieldDef updateFieldDef (Update f _ _) = persistFieldDef f-updateFieldDef BackendUpdate {} = error "updateFieldDef: did not expect BackendUpdate"+updateFieldDef BackendUpdate{} = error "updateFieldDef: did not expect BackendUpdate"  updatePersistValue :: Update v -> PersistValue updatePersistValue (Update _ v _) = toPersistValue v@@ -213,20 +219,23 @@ commaSeparated :: [Text] -> Text commaSeparated = T.intercalate ", " -mkUpdateText :: PersistEntity record => SqlBackend -> Update record -> Text+mkUpdateText :: (PersistEntity record) => SqlBackend -> Update record -> Text mkUpdateText conn = mkUpdateText' (connEscapeFieldName conn) id  -- TODO: incorporate the table names into a sum type-mkUpdateText' :: PersistEntity record => (FieldNameDB -> Text) -> (Text -> Text) -> Update record -> Text+mkUpdateText'+    :: (PersistEntity record)+    => (FieldNameDB -> Text) -> (Text -> Text) -> Update record -> Text mkUpdateText' escapeName refColumn x =-  case updateUpdate x of-    Assign -> n <> "=?"-    Add -> T.concat [n, "=", refColumn n, "+?"]-    Subtract -> T.concat [n, "=", refColumn n, "-?"]-    Multiply -> T.concat [n, "=", refColumn n, "*?"]-    Divide -> T.concat [n, "=", refColumn n, "/?"]-    BackendSpecificUpdate up ->-      error . T.unpack $ "mkUpdateText: BackendSpecificUpdate " <> up <> " not supported"+    case updateUpdate x of+        Assign -> n <> "=?"+        Add -> T.concat [n, "=", refColumn n, "+?"]+        Subtract -> T.concat [n, "=", refColumn n, "-?"]+        Multiply -> T.concat [n, "=", refColumn n, "*?"]+        Divide -> T.concat [n, "=", refColumn n, "/?"]+        BackendSpecificUpdate up ->+            error . T.unpack $+                "mkUpdateText: BackendSpecificUpdate " <> up <> " not supported"   where     n = escapeName . fieldDB . updateFieldDef $ x @@ -240,7 +249,7 @@ -- -- @since 2.11.0.0 mkInsertValues-    :: PersistEntity rec+    :: (PersistEntity rec)     => rec     -> [PersistValue] mkInsertValues entity =@@ -277,11 +286,21 @@ parseExistsResult :: Maybe [PersistValue] -> Text -> String -> Bool parseExistsResult mm sql errloc =     case mm of-        Just [PersistBool b]  -> b -- Postgres+        Just [PersistBool b] -> b -- Postgres         Just [PersistInt64 i] -> i > 0 -- MySQL, SQLite         Just [PersistDouble i] -> (truncate i :: Int64) > 0 -- gb oracle         Just [PersistByteString i] -> case readInteger i of -- gb mssql-                                        Just (ret,"") -> ret > 0-                                        xs -> error $ "invalid number i["++show i++"] xs[" ++ show xs ++ "]"-        Just xs -> error $ errloc ++ ": Expected a boolean, int, double, or bytestring; got: " ++ show xs ++ " for query: " ++ show sql-        Nothing -> error $ errloc ++ ": Expected a boolean, int, double, or bytestring; got: Nothing for query: " ++ show sql+            Just (ret, "") -> ret > 0+            xs -> error $ "invalid number i[" ++ show i ++ "] xs[" ++ show xs ++ "]"+        Just xs ->+            error $+                errloc+                    ++ ": Expected a boolean, int, double, or bytestring; got: "+                    ++ show xs+                    ++ " for query: "+                    ++ show sql+        Nothing ->+            error $+                errloc+                    ++ ": Expected a boolean, int, double, or bytestring; got: Nothing for query: "+                    ++ show sql
Database/Persist/SqlBackend.hs view
@@ -5,14 +5,14 @@     ( -- * The type and construction       SqlBackend     , mkSqlBackend-    , MkSqlBackendArgs(..)+    , MkSqlBackendArgs (..)     , SqlBackendHooks     , emptySqlBackendHooks-    -- * Utilities -    -- $utilities+      -- * Utilities+      -- $utilities -    -- ** SqlBackend Getters+      -- ** SqlBackend Getters     , getRDBMS     , getEscapedFieldName     , getEscapedRawName@@ -21,7 +21,8 @@     , getConnUpsertSql     , getConnVault     , getConnHooks-    -- ** SqlBackend Setters++      -- ** SqlBackend Setters     , setConnMaxParams     , setConnRepsertManySql     , setConnInsertManySql@@ -30,21 +31,24 @@     , setConnVault     , modifyConnVault     , setConnHooks-    -- ** SqlBackendHooks++      -- ** SqlBackendHooks     ) where  import Control.Monad.Reader import Data.List.NonEmpty (NonEmpty) import Data.Text (Text) import Data.Vault.Strict (Vault)-import Database.Persist.Class.PersistStore (BackendCompatible(..))+import Database.Persist.Class.PersistStore (BackendCompatible (..)) import Database.Persist.Names import Database.Persist.SqlBackend.Internal import qualified Database.Persist.SqlBackend.Internal as SqlBackend-       (SqlBackend(..))+    ( SqlBackend (..)+    ) import Database.Persist.SqlBackend.Internal.InsertSqlResult import Database.Persist.SqlBackend.Internal.MkSqlBackend as Mk-       (MkSqlBackendArgs(..))+    ( MkSqlBackendArgs (..)+    ) import Database.Persist.Types.Base  -- $utilities@@ -144,7 +148,7 @@ -- -- @since 2.13.3.0 getConnVault-    ::  (BackendCompatible SqlBackend backend, MonadReader backend m)+    :: (BackendCompatible SqlBackend backend, MonadReader backend m)     => m Vault getConnVault = do     asks (SqlBackend.connVault . projectBackend)@@ -153,7 +157,7 @@ -- -- @since 2.13.3.0 getConnHooks-    ::  (BackendCompatible SqlBackend backend, MonadReader backend m)+    :: (BackendCompatible SqlBackend backend, MonadReader backend m)     => m SqlBackendHooks getConnHooks = do     asks (SqlBackend.connHooks . projectBackend)@@ -168,7 +172,6 @@ getRDBMS = do     asks (SqlBackend.connRDBMS . projectBackend) - -- | Set the maximum parameters that may be issued in a given SQL query. This -- should be used only if the database backend have this limitation. --@@ -178,7 +181,7 @@     -> SqlBackend     -> SqlBackend setConnMaxParams i sb =-    sb { connMaxParams = Just i }+    sb{connMaxParams = Just i}  -- | Set the 'connRepsertManySql' field on the 'SqlBackend'. This should only be -- set by the database backend library. If this is not set, a slow default will@@ -190,7 +193,7 @@     -> SqlBackend     -> SqlBackend setConnRepsertManySql mkQuery sb =-    sb { connRepsertManySql = Just mkQuery }+    sb{connRepsertManySql = Just mkQuery}  -- | Set the 'connInsertManySql' field on the 'SqlBackend'. This should only be -- used by the database backend library to provide an efficient implementation@@ -202,7 +205,7 @@     -> SqlBackend     -> SqlBackend setConnInsertManySql mkQuery sb =-    sb { connInsertManySql = Just mkQuery }+    sb{connInsertManySql = Just mkQuery}  -- | Set the 'connUpsertSql' field on the 'SqlBackend'. This should only be used -- by the database backend library to provide an efficient implementation of@@ -214,7 +217,7 @@     -> SqlBackend     -> SqlBackend setConnUpsertSql mkQuery sb =-    sb { connUpsertSql = Just mkQuery }+    sb{connUpsertSql = Just mkQuery}  -- | Set the 'connPutManySql field on the 'SqlBackend'. This should only be used -- by the database backend library to provide an efficient implementation of@@ -225,26 +228,26 @@     :: (EntityDef -> Int -> Text)     -> SqlBackend     -> SqlBackend-setConnPutManySql  mkQuery sb =-    sb { connPutManySql = Just mkQuery }+setConnPutManySql mkQuery sb =+    sb{connPutManySql = Just mkQuery}  -- | Set the vault on the provided database backend. -- -- @since 2.13.0 setConnVault :: Vault -> SqlBackend -> SqlBackend setConnVault vault sb =-    sb { connVault = vault }+    sb{connVault = vault}  -- | Modify the vault on the provided database backend. -- -- @since 2.13.0-modifyConnVault :: (Vault -> Vault) -> SqlBackend  -> SqlBackend+modifyConnVault :: (Vault -> Vault) -> SqlBackend -> SqlBackend modifyConnVault f sb =-    sb { connVault = f $ connVault sb }+    sb{connVault = f $ connVault sb}  -- | Set hooks on the provided database backend. -- -- @since 2.13.0 setConnHooks :: SqlBackendHooks -> SqlBackend -> SqlBackend setConnHooks hooks sb =-    sb { connHooks = hooks }+    sb{connHooks = hooks}
Database/Persist/SqlBackend/Internal.hs view
@@ -44,7 +44,8 @@     -- ^ SQL for inserting many rows and returning their primary keys, for     -- backends that support this functionality. If 'Nothing', rows will be     -- inserted one-at-a-time using 'connInsertSql'.-    , connUpsertSql :: Maybe (EntityDef -> NonEmpty (FieldNameHS, FieldNameDB) -> Text -> Text)+    , connUpsertSql+        :: Maybe (EntityDef -> NonEmpty (FieldNameHS, FieldNameDB) -> Text -> Text)     -- ^ Some databases support performing UPSERT _and_ RETURN entity     -- in a single call.     --@@ -110,7 +111,7 @@     -- ^ A tag displaying what database the 'SqlBackend' is for. Can be     -- used to differentiate features in downstream libraries for different     -- database backends.-    , connLimitOffset :: (Int,Int) -> Text -> Text+    , connLimitOffset :: (Int, Int) -> Text -> Text     -- ^ Attach a 'LIMIT/OFFSET' clause to a SQL query. Note that     -- LIMIT/OFFSET is problematic for performance, and indexed range     -- queries are the superior way to offer pagination.@@ -146,9 +147,10 @@     }  emptySqlBackendHooks :: SqlBackendHooks-emptySqlBackendHooks = SqlBackendHooks-    { hookGetStatement = \_ _ s -> pure s-    }+emptySqlBackendHooks =+    SqlBackendHooks+        { hookGetStatement = \_ _ s -> pure s+        }  -- | A function for creating a value of the 'SqlBackend' type. You should prefer -- to use this instead of the constructor for 'SqlBackend', because default@@ -157,7 +159,7 @@ -- -- @since 2.13.0.0 mkSqlBackend :: MkSqlBackendArgs -> SqlBackend-mkSqlBackend MkSqlBackendArgs {..} =+mkSqlBackend MkSqlBackendArgs{..} =     SqlBackend         { connMaxParams = Nothing         , connRepsertManySql = Nothing
Database/Persist/SqlBackend/Internal/InsertSqlResult.hs view
@@ -1,7 +1,7 @@ module Database.Persist.SqlBackend.Internal.InsertSqlResult where -import Database.Persist.Types.Base (PersistValue) import Data.Text (Text)+import Database.Persist.Types.Base (PersistValue)  data InsertSqlResult     = ISRSingle Text
Database/Persist/SqlBackend/Internal/IsolationLevel.hs view
@@ -1,18 +1,20 @@ module Database.Persist.SqlBackend.Internal.IsolationLevel where -import Data.String (IsString(..))+import Data.String (IsString (..))  -- | Please refer to the documentation for the database in question for a full -- overview of the semantics of the varying isolation levels-data IsolationLevel = ReadUncommitted-                    | ReadCommitted-                    | RepeatableRead-                    | Serializable-                    deriving (Show, Eq, Enum, Ord, Bounded)+data IsolationLevel+    = ReadUncommitted+    | ReadCommitted+    | RepeatableRead+    | Serializable+    deriving (Show, Eq, Enum, Ord, Bounded)  makeIsolationLevelStatement :: (Monoid s, IsString s) => IsolationLevel -> s-makeIsolationLevelStatement l = "SET TRANSACTION ISOLATION LEVEL " <> case l of-    ReadUncommitted -> "READ UNCOMMITTED"-    ReadCommitted -> "READ COMMITTED"-    RepeatableRead -> "REPEATABLE READ"-    Serializable -> "SERIALIZABLE"+makeIsolationLevelStatement l =+    "SET TRANSACTION ISOLATION LEVEL " <> case l of+        ReadUncommitted -> "READ UNCOMMITTED"+        ReadCommitted -> "READ COMMITTED"+        RepeatableRead -> "REPEATABLE READ"+        Serializable -> "SERIALIZABLE"
Database/Persist/SqlBackend/Internal/MkSqlBackend.hs view
@@ -3,14 +3,14 @@ module Database.Persist.SqlBackend.Internal.MkSqlBackend where  import Control.Monad.Logger (Loc, LogLevel, LogSource, LogStr)+import Data.IORef (IORef)+import Data.Map (Map) import Data.Text (Text) import Database.Persist.Names import Database.Persist.SqlBackend.Internal.InsertSqlResult import Database.Persist.SqlBackend.Internal.IsolationLevel import Database.Persist.SqlBackend.Internal.Statement import Database.Persist.Types.Base-import Data.Map (Map)-import Data.IORef (IORef)  -- | This type shares many of the same field names as the 'SqlBackend' type. -- It's useful for library authors to use this when migrating from using the@@ -68,7 +68,7 @@     -- ^ A tag displaying what database the 'SqlBackend' is for. Can be     -- used to differentiate features in downstream libraries for different     -- database backends.-    , connLimitOffset :: (Int,Int) -> Text -> Text+    , connLimitOffset :: (Int, Int) -> Text -> Text     -- ^ Attach a 'LIMIT/OFFSET' clause to a SQL query. Note that     -- LIMIT/OFFSET is problematic for performance, and indexed range     -- queries are the superior way to offer pagination.
Database/Persist/SqlBackend/Internal/SqlPoolHooks.hs view
@@ -1,6 +1,7 @@ module Database.Persist.SqlBackend.Internal.SqlPoolHooks-  ( SqlPoolHooks(..)-  ) where+    ( SqlPoolHooks (..)+    ) where+ import Control.Exception (SomeException) import Database.Persist.SqlBackend.Internal.IsolationLevel 
Database/Persist/SqlBackend/Internal/StatementCache.hs view
@@ -14,7 +14,8 @@     , statementCacheSize :: IO Int     } -newtype StatementCacheKey = StatementCacheKey { cacheKey :: Text }+newtype StatementCacheKey = StatementCacheKey {cacheKey :: Text}+ -- Wrapping around this to allow for more efficient keying mechanisms -- in the future, perhaps. 
Database/Persist/SqlBackend/SqlPoolHooks.hs view
@@ -1,26 +1,26 @@ module Database.Persist.SqlBackend.SqlPoolHooks-  ( SqlPoolHooks-  , defaultSqlPoolHooks-  , getAlterBackend-  , modifyAlterBackend-  , setAlterBackend-  , getRunBefore-  , modifyRunBefore-  , setRunBefore-  , getRunAfter-  , modifyRunAfter-  , setRunAfter-  , getRunOnException-  )-  where+    ( SqlPoolHooks+    , defaultSqlPoolHooks+    , getAlterBackend+    , modifyAlterBackend+    , setAlterBackend+    , getRunBefore+    , modifyRunBefore+    , setRunBefore+    , getRunAfter+    , modifyRunAfter+    , setRunAfter+    , getRunOnException+    )+where  import Control.Exception import Control.Monad.IO.Class+import Database.Persist.Class.PersistStore import Database.Persist.Sql.Raw import Database.Persist.SqlBackend.Internal-import Database.Persist.SqlBackend.Internal.SqlPoolHooks import Database.Persist.SqlBackend.Internal.IsolationLevel-import Database.Persist.Class.PersistStore+import Database.Persist.SqlBackend.Internal.SqlPoolHooks  -- | Lifecycle hooks that may be altered to extend SQL pool behavior -- in a backwards compatible fashion.@@ -33,60 +33,95 @@ -- - 'runOnException' rolls back the current transaction -- -- @since 2.13.3.0-defaultSqlPoolHooks :: (MonadIO m, BackendCompatible SqlBackend backend) => SqlPoolHooks m backend-defaultSqlPoolHooks = SqlPoolHooks-    { alterBackend = pure-    , runBefore = \conn mi -> do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend-        liftIO $ connBegin sqlBackend getter mi-    , runAfter = \conn _ -> do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend-        liftIO $ connCommit sqlBackend getter-    , runOnException = \conn _ _ -> do-        let sqlBackend = projectBackend conn-        let getter = getStmtConn sqlBackend-        liftIO $ connRollback sqlBackend getter-    }+defaultSqlPoolHooks+    :: (MonadIO m, BackendCompatible SqlBackend backend) => SqlPoolHooks m backend+defaultSqlPoolHooks =+    SqlPoolHooks+        { alterBackend = pure+        , runBefore = \conn mi -> do+            let+                sqlBackend = projectBackend conn+            let+                getter = getStmtConn sqlBackend+            liftIO $ connBegin sqlBackend getter mi+        , runAfter = \conn _ -> do+            let+                sqlBackend = projectBackend conn+            let+                getter = getStmtConn sqlBackend+            liftIO $ connCommit sqlBackend getter+        , runOnException = \conn _ _ -> do+            let+                sqlBackend = projectBackend conn+            let+                getter = getStmtConn sqlBackend+            liftIO $ connRollback sqlBackend getter+        }  getAlterBackend :: SqlPoolHooks m backend -> (backend -> m backend) getAlterBackend = alterBackend -modifyAlterBackend :: SqlPoolHooks m backend -> ((backend -> m backend) -> (backend -> m backend)) -> SqlPoolHooks m backend-modifyAlterBackend hooks f = hooks { alterBackend = f $ alterBackend hooks }--setAlterBackend :: SqlPoolHooks m backend -> (backend -> m backend) -> SqlPoolHooks m backend-setAlterBackend hooks f = hooks { alterBackend = f }+modifyAlterBackend+    :: SqlPoolHooks m backend+    -> ((backend -> m backend) -> (backend -> m backend))+    -> SqlPoolHooks m backend+modifyAlterBackend hooks f = hooks{alterBackend = f $ alterBackend hooks} +setAlterBackend+    :: SqlPoolHooks m backend -> (backend -> m backend) -> SqlPoolHooks m backend+setAlterBackend hooks f = hooks{alterBackend = f} -getRunBefore :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ())+getRunBefore+    :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) getRunBefore = runBefore -modifyRunBefore :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> (backend -> Maybe IsolationLevel -> m ())) -> SqlPoolHooks m backend-modifyRunBefore hooks f = hooks { runBefore = f $ runBefore hooks }--setRunBefore :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend-setRunBefore h f = h { runBefore = f }+modifyRunBefore+    :: SqlPoolHooks m backend+    -> ( (backend -> Maybe IsolationLevel -> m ())+         -> (backend -> Maybe IsolationLevel -> m ())+       )+    -> SqlPoolHooks m backend+modifyRunBefore hooks f = hooks{runBefore = f $ runBefore hooks} +setRunBefore+    :: SqlPoolHooks m backend+    -> (backend -> Maybe IsolationLevel -> m ())+    -> SqlPoolHooks m backend+setRunBefore h f = h{runBefore = f} -getRunAfter :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ())+getRunAfter+    :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) getRunAfter = runAfter -modifyRunAfter :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> m ()) -> (backend -> Maybe IsolationLevel -> m ())) -> SqlPoolHooks m backend-modifyRunAfter hooks f = hooks { runAfter = f $ runAfter hooks }--setRunAfter :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> m ()) -> SqlPoolHooks m backend-setRunAfter hooks f = hooks { runAfter = f }+modifyRunAfter+    :: SqlPoolHooks m backend+    -> ( (backend -> Maybe IsolationLevel -> m ())+         -> (backend -> Maybe IsolationLevel -> m ())+       )+    -> SqlPoolHooks m backend+modifyRunAfter hooks f = hooks{runAfter = f $ runAfter hooks} +setRunAfter+    :: SqlPoolHooks m backend+    -> (backend -> Maybe IsolationLevel -> m ())+    -> SqlPoolHooks m backend+setRunAfter hooks f = hooks{runAfter = f} -getRunOnException :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> SomeException -> m ())+getRunOnException+    :: SqlPoolHooks m backend+    -> (backend -> Maybe IsolationLevel -> SomeException -> m ()) getRunOnException = runOnException -modifyRunOnException :: SqlPoolHooks m backend -> ((backend -> Maybe IsolationLevel -> SomeException -> m ()) -> (backend -> Maybe IsolationLevel -> SomeException -> m ())) -> SqlPoolHooks m backend-modifyRunOnException hooks f = hooks { runOnException = f $ runOnException hooks }--setRunOnException :: SqlPoolHooks m backend -> (backend -> Maybe IsolationLevel -> SomeException -> m ()) -> SqlPoolHooks m backend-setRunOnException hooks f = hooks { runOnException = f }-+modifyRunOnException+    :: SqlPoolHooks m backend+    -> ( (backend -> Maybe IsolationLevel -> SomeException -> m ())+         -> (backend -> Maybe IsolationLevel -> SomeException -> m ())+       )+    -> SqlPoolHooks m backend+modifyRunOnException hooks f = hooks{runOnException = f $ runOnException hooks} +setRunOnException+    :: SqlPoolHooks m backend+    -> (backend -> Maybe IsolationLevel -> SomeException -> m ())+    -> SqlPoolHooks m backend+setRunOnException hooks f = hooks{runOnException = f}
Database/Persist/SqlBackend/StatementCache.hs view
@@ -1,20 +1,21 @@ {-# LANGUAGE RecordWildCards #-}+ module Database.Persist.SqlBackend.StatementCache-  ( StatementCache-  , StatementCacheKey-  , mkCacheKeyFromQuery-  , MkStatementCache(..)-  , mkSimpleStatementCache-  , mkStatementCache-  ) where+    ( StatementCache+    , StatementCacheKey+    , mkCacheKeyFromQuery+    , MkStatementCache (..)+    , mkSimpleStatementCache+    , mkStatementCache+    ) where  import Data.Foldable import Data.IORef+import Data.Map (Map) import qualified Data.Map as Map+import Data.Text (Text) import Database.Persist.SqlBackend.Internal.Statement import Database.Persist.SqlBackend.Internal.StatementCache-import Data.Map (Map)-import Data.Text (Text)  -- | Configuration parameters for creating a custom statement cache --@@ -43,7 +44,6 @@     -- @since 2.13.3     } - -- | Make a simple statement cache that will cache statements if they are not currently cached. -- -- @since 2.13.3@@ -54,7 +54,8 @@         , statementCacheInsert = \sql stmt ->             modifyIORef' stmtMap (Map.insert (cacheKey sql) stmt)         , statementCacheClear = do-            oldStatements <- atomicModifyIORef' stmtMap (\oldStatements -> (Map.empty, oldStatements))+            oldStatements <-+                atomicModifyIORef' stmtMap (\oldStatements -> (Map.empty, oldStatements))             traverse_ stmtFinalize oldStatements         , statementCacheSize = Map.size <$> readIORef stmtMap         }@@ -63,4 +64,4 @@ -- -- @since 2.13.0 mkStatementCache :: MkStatementCache -> StatementCache-mkStatementCache MkStatementCache{..} = StatementCache { .. }+mkStatementCache MkStatementCache{..} = StatementCache{..}
Database/Persist/TH.hs view
@@ -3,8 +3,6 @@ -- -- For documentation on the domain specific language used for defining database -- models, see "Database.Persist.Quasi".------ module Database.Persist.TH     ( -- * Parse entity defs       persistWith@@ -12,14 +10,17 @@     , persistLowerCase     , persistFileWith     , persistManyFileWith+       -- * Turn @EntityDef@s into types     , mkPersist     , mkPersistWith+       -- ** Configuring Entity Definition     , MkPersistSettings     , mkPersistSettings     , sqlSettings-    -- *** Record Fields (for update/viewing settings)++      -- *** Record Fields (for update/viewing settings)     , mpsBackend     , mpsGeneric     , mpsPrefixFields@@ -31,10 +32,12 @@     , mpsGenerateLenses     , mpsDeriveInstances     , mpsCamelCaseCompositeKeySelector-    , EntityJSON(..)-    -- ** Implicit ID Columns+    , EntityJSON (..)++      -- ** Implicit ID Columns     , ImplicitIdDef     , setImplicitIdDef+       -- * Various other TH functions     , mkMigrate     , migrateModels
Database/Persist/Types.hs view
@@ -3,27 +3,35 @@ -- future, this module will be reorganized, and many of the dependent modules -- will be viewable on their own for easier documentation and organization. module Database.Persist.Types-    (-    -- * Various Types of Names-    -- | There are so many kinds of names. @persistent@ defines newtype wrappers-    -- for 'Text' so you don't confuse what a name is and what it is-    -- supposed to be used for+    ( -- * Various Types of Names++      -- | There are so many kinds of names. @persistent@ defines newtype wrappers+      -- for 'Text' so you don't confuse what a name is and what it is+      -- supposed to be used for       module Database.Persist.Names-    -- * Database Definitions-    -- ** Entity/Table Definitions-    -- | The 'EntityDef' type is used by @persistent@ to generate Haskell code,-    -- generate database migrations, and maintain metadata about entities. These-    -- are generated in the call to 'Database.Persist.TH.mkPersist'.++      -- * Database Definitions++      -- ** Entity/Table Definitions++      -- | The 'EntityDef' type is used by @persistent@ to generate Haskell code,+      -- generate database migrations, and maintain metadata about entities. These+      -- are generated in the call to 'Database.Persist.TH.mkPersist'.     , module Database.Persist.EntityDef-    -- ** Field definitions-    -- | The 'FieldDef' type is used to describe how a field should be-    -- represented at the Haskell and database layers.++      -- ** Field definitions++      -- | The 'FieldDef' type is used to describe how a field should be+      -- represented at the Haskell and database layers.     , module Database.Persist.FieldDef-    -- * Intermediate Values-    -- | The 'PersistValue' type is used as an intermediate layer between-    -- database and Haskell types.++      -- * Intermediate Values++      -- | The 'PersistValue' type is used as an intermediate layer between+      -- database and Haskell types.     , module Database.Persist.PersistValue-    -- * Other Useful Stuff++      -- * Other Useful Stuff     , Update (..)     , BackendSpecificUpdate     , SelectOpt (..)@@ -32,8 +40,9 @@     , BackendSpecificFilter     , Key     , Entity (..)-    , OverflowNatural(..)-    -- * The rest of the types+    , OverflowNatural (..)++      -- * The rest of the types     , module Database.Persist.Types.Base     ) where @@ -48,33 +57,33 @@ -- persistent, just strewn across the table. in 2.13 let's get this cleaned up -- and a bit more tidy. import Database.Persist.Types.Base-       ( Attr-       , CascadeAction(..)-       , Checkmark(..)-       , CompositeDef(..)-       , EmbedEntityDef(..)-       , EmbedFieldDef(..)-       , ExtraLine-       , FieldAttr(..)-       , FieldCascade(..)-       , FieldDef(..)-       , FieldType(..)-       , ForeignDef(..)-       , ForeignFieldDef-       , IsNullable(..)-       , LiteralType(..)-       , PersistException(..)-       , PersistFilter(..)-       , PersistUpdate(..)-       , PersistValue(..)-       , ReferenceDef(..)-       , SqlType(..)-       , UniqueDef(..)-       , UpdateException(..)-       , WhyNullable(..)-       , fieldAttrsContainsNullable-       , keyAndEntityFields-       , keyAndEntityFieldsDatabase-       , noCascade-       , parseFieldAttrs-       )+    ( Attr+    , CascadeAction (..)+    , Checkmark (..)+    , CompositeDef (..)+    , EmbedEntityDef (..)+    , EmbedFieldDef (..)+    , ExtraLine+    , FieldAttr (..)+    , FieldCascade (..)+    , FieldDef (..)+    , FieldType (..)+    , ForeignDef (..)+    , ForeignFieldDef+    , IsNullable (..)+    , LiteralType (..)+    , PersistException (..)+    , PersistFilter (..)+    , PersistUpdate (..)+    , PersistValue (..)+    , ReferenceDef (..)+    , SqlType (..)+    , UniqueDef (..)+    , UpdateException (..)+    , WhyNullable (..)+    , fieldAttrsContainsNullable+    , keyAndEntityFields+    , keyAndEntityFieldsDatabase+    , noCascade+    , parseFieldAttrs+    )
Database/Persist/Types/Base.hs view
@@ -9,37 +9,39 @@  module Database.Persist.Types.Base     ( module Database.Persist.Types.Base-    -- * Re-exports-    , PersistValue(..)++      -- * Re-exports+    , PersistValue (..)     , fromPersistValueText-    , LiteralType(..)-    , SourceSpan(..)+    , LiteralType (..)+    , SourceSpan (..)     ) where  import Control.Exception (Exception) import Data.Char (isSpace)-import Data.List.NonEmpty (NonEmpty(..))+import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NEL import Data.Map (Map) import Data.Maybe (isNothing) import Data.Text (Text) import qualified Data.Text as T import Data.Word (Word32)-import Language.Haskell.TH.Syntax (Lift(..))+import Language.Haskell.TH.Syntax (Lift (..)) import Web.HttpApiData-       ( FromHttpApiData(..)-       , ToHttpApiData(..)-       , parseBoundedTextData-       , showTextData-       )-import Web.PathPieces (PathPiece(..))-    -- Bring `Lift (Map k v)` instance into scope, as well as `Lift Text`-    -- instance on pre-1.2.4 versions of `text`+    ( FromHttpApiData (..)+    , ToHttpApiData (..)+    , parseBoundedTextData+    , showTextData+    )+import Web.PathPieces (PathPiece (..))++-- Bring `Lift (Map k v)` instance into scope, as well as `Lift Text`+-- instance on pre-1.2.4 versions of `text` import Instances.TH.Lift ()  import Database.Persist.Names import Database.Persist.PersistValue-import Database.Persist.Types.SourceSpan (SourceSpan(..))+import Database.Persist.Types.SourceSpan (SourceSpan (..))  -- | A 'Checkmark' should be used as a field type whenever a -- uniqueness constraint should guarantee that a certain kind of@@ -83,12 +85,13 @@ -- type available.  Note that we never use @FALSE@, just @TRUE@ -- and @NULL@.  Provides the same behavior @Maybe ()@ would if -- @()@ was a valid 'PersistField'.-data Checkmark = Active-                 -- ^ When used on a uniqueness constraint, there-                 -- may be at most one 'Active' record.-               | Inactive-                 -- ^ When used on a uniqueness constraint, there-                 -- may be any number of 'Inactive' records.+data Checkmark+    = -- | When used on a uniqueness constraint, there+      -- may be at most one 'Active' record.+      Active+    | -- | When used on a uniqueness constraint, there+      -- may be any number of 'Inactive' records.+      Inactive     deriving (Eq, Ord, Read, Show, Enum, Bounded)  instance ToHttpApiData Checkmark where@@ -98,12 +101,12 @@     parseUrlPiece = parseBoundedTextData  instance PathPiece Checkmark where-  toPathPiece Active = "active"-  toPathPiece Inactive = "inactive"+    toPathPiece Active = "active"+    toPathPiece Inactive = "inactive" -  fromPathPiece "active" = Just Active-  fromPathPiece "inactive" = Just Inactive-  fromPathPiece _ = Nothing+    fromPathPiece "active" = Just Active+    fromPathPiece "inactive" = Just Inactive+    fromPathPiece _ = Nothing  data IsNullable     = Nullable !WhyNullable@@ -112,7 +115,7 @@  fieldAttrsContainsNullable :: [FieldAttr] -> IsNullable fieldAttrsContainsNullable s-    | FieldAttrMaybe    `elem` s = Nullable ByMaybeAttr+    | FieldAttrMaybe `elem` s = Nullable ByMaybeAttr     | FieldAttrNullable `elem` s = Nullable ByNullableAttr     | otherwise = NotNullable @@ -121,9 +124,10 @@ -- type changed from @A@ to @Maybe A@.  OTOH, a field that is -- nullable because of a @nullable@ tag will remain with the same -- type.-data WhyNullable = ByMaybeAttr-                 | ByNullableAttr-                  deriving (Eq, Show)+data WhyNullable+    = ByMaybeAttr+    | ByNullableAttr+    deriving (Eq, Show)  -- | An 'EntityDef' represents the information that @persistent@ knows -- about an Entity. It uses this information to generate the Haskell@@ -131,27 +135,27 @@ data EntityDef = EntityDef     { entityHaskell :: !EntityNameHS     -- ^ The name of the entity as Haskell understands it.-    , entityDB      :: !EntityNameDB+    , entityDB :: !EntityNameDB     -- ^ The name of the database table corresponding to the entity.-    , entityId      :: !EntityIdDef+    , entityId :: !EntityIdDef     -- ^ The entity's primary key or identifier.-    , entityAttrs   :: ![Attr]+    , entityAttrs :: ![Attr]     -- ^ The @persistent@ entity syntax allows you to add arbitrary 'Attr's     -- to an entity using the @!@ operator. Those attributes are stored in     -- this list.-    , entityFields  :: ![FieldDef]+    , entityFields :: ![FieldDef]     -- ^ The fields for this entity. Note that the ID field will not be     -- present in this list. To get all of the fields for an entity, use     -- 'keyAndEntityFields'.     , entityUniques :: ![UniqueDef]     -- ^ The Uniqueness constraints for this entity.-    , entityForeigns:: ![ForeignDef]+    , entityForeigns :: ![ForeignDef]     -- ^ The foreign key relationships that this entity has to other     -- entities.     , entityDerives :: ![Text]     -- ^ A list of type classes that have been derived for this entity.-    , entityExtra   :: !(Map Text [ExtraLine])-    , entitySum     :: !Bool+    , entityExtra :: !(Map Text [ExtraLine])+    , entitySum :: !Bool     -- ^ Whether or not this entity represents a sum type in the database.     , entityComments :: !(Maybe Text)     -- ^ Optional comments on the entity.@@ -172,18 +176,18 @@ -- -- @since 2.13.0.0 data EntityIdDef-    = EntityIdField !FieldDef-    -- ^ The entity has a single key column, and it is a surrogate key - that-    -- is, you can't go from @rec -> Key rec@.-    ---    -- @since 2.13.0.0-    | EntityIdNaturalKey !CompositeDef-    -- ^ The entity has a natural key. This means you can write @rec -> Key rec@-    -- because all the key fields are present on the datatype.-    ---    -- A natural key can have one or more columns.-    ---    -- @since 2.13.0.0+    = -- | The entity has a single key column, and it is a surrogate key - that+      -- is, you can't go from @rec -> Key rec@.+      --+      -- @since 2.13.0.0+      EntityIdField !FieldDef+    | -- | The entity has a natural key. This means you can write @rec -> Key rec@+      -- because all the key fields are present on the datatype.+      --+      -- A natural key can have one or more columns.+      --+      -- @since 2.13.0.0+      EntityIdNaturalKey !CompositeDef     deriving (Show, Eq, Read, Ord, Lift)  -- | Return the @['FieldDef']@ for the entity keys.@@ -238,11 +242,12 @@         EntityIdNaturalKey _ ->             case NEL.nonEmpty fields of                 Nothing ->-                    error $ mconcat-                        [ "persistent internal guarantee failed: entity is "-                        , "defined with an entityId = EntityIdNaturalKey, "-                        , "but somehow doesn't have any entity fields."-                        ]+                    error $+                        mconcat+                            [ "persistent internal guarantee failed: entity is "+                            , "defined with an entityId = EntityIdNaturalKey, "+                            , "but somehow doesn't have any entity fields."+                            ]                 Just xs ->                     xs @@ -258,147 +263,147 @@ -- -- @since 2.11.0.0 data FieldAttr-    = FieldAttrMaybe-    -- ^ The 'Maybe' keyword goes after the type. This indicates that the column-    -- is nullable, and the generated Haskell code will have a @'Maybe'@ type-    -- for it.-    ---    -- Example:-    ---    -- @-    -- User-    --     name Text Maybe-    -- @-    | FieldAttrNullable-    -- ^ This indicates that the column is nullable, but should not have-    -- a 'Maybe' type. For this to work out, you need to ensure that the-    -- 'PersistField' instance for the type in question can support-    -- a 'PersistNull' value.-    ---    -- @-    -- data What = NoWhat | Hello Text-    ---    -- instance PersistField What where-    --     fromPersistValue PersistNull =-    --         pure NoWhat-    --     fromPersistValue pv =-    --         Hello <$> fromPersistValue pv-    ---    -- instance PersistFieldSql What where-    --     sqlType _ = SqlString-    ---    -- User-    --     what What nullable-    -- @-    | FieldAttrMigrationOnly-    -- ^ This tag means that the column will not be present on the Haskell code,-    -- but will not be removed from the database. Useful to deprecate fields in-    -- phases.-    ---    -- You should set the column to be nullable in the database. Otherwise,-    -- inserts won't have values.-    ---    -- @-    -- User-    --     oldName Text MigrationOnly-    --     newName Text-    -- @-    | FieldAttrSafeToRemove-    -- ^ A @SafeToRemove@ attribute is not present on the Haskell datatype, and-    -- the backend migrations should attempt to drop the column without-    -- triggering any unsafe migration warnings.-    ---    -- Useful after you've used @MigrationOnly@ to remove a column from the-    -- database in phases.-    ---    -- @-    -- User-    --     oldName Text SafeToRemove-    --     newName Text-    -- @-    | FieldAttrNoreference-    -- ^ This attribute indicates that we should not create a foreign key-    -- reference from a column. By default, @persistent@ will try and create a-    -- foreign key reference for a column if it can determine that the type of-    -- the column is a @'Key' entity@ or an @EntityId@  and the @Entity@'s name-    -- was present in 'mkPersist'.-    ---    -- This is useful if you want to use the explicit foreign key syntax.-    ---    -- @-    -- Post-    --     title    Text-    ---    -- Comment-    --     postId   PostId      noreference-    --     Foreign Post fk_comment_post postId-    -- @-    | FieldAttrReference Text-    -- ^ This is set to specify precisely the database table the column refers-    -- to.-    ---    -- @-    -- Post-    --     title    Text-    ---    -- Comment-    --     postId   PostId references="post"-    -- @-    ---    -- You should not need this - @persistent@ should be capable of correctly-    -- determining the target table's name. If you do need this, please file an-    -- issue describing why.-    | FieldAttrConstraint Text-    -- ^ Specify a name for the constraint on the foreign key reference for this-    -- table.-    ---    -- @-    -- Post-    --     title    Text-    ---    -- Comment-    --     postId   PostId constraint="my_cool_constraint_name"-    -- @-    | FieldAttrDefault Text-    -- ^ Specify the default value for a column.-    ---    -- @-    -- User-    --     createdAt    UTCTime     default="NOW()"-    -- @-    ---    -- Note that a @default=@ attribute does not mean you can omit the value-    -- while inserting.-    | FieldAttrSqltype Text-    -- ^ Specify a custom SQL type for the column. Generally, you should define-    -- a custom datatype with a custom 'PersistFieldSql' instance instead of-    -- using this.-    ---    -- @-    -- User-    --     uuid     Text    sqltype="UUID"-    -- @-    | FieldAttrMaxlen Integer-    -- ^ Set a maximum length for a column. Useful for VARCHAR and indexes.-    ---    -- @-    -- User-    --     name     Text    maxlen=200-    ---    --     UniqueName name-    -- @-    | FieldAttrSql Text-    -- ^ Specify the database name of the column.-    ---    -- @-    -- User-    --     blarghle     Int     sql="b_l_a_r_g_h_l_e"-    -- @-    ---    -- Useful for performing phased migrations, where one column is renamed to-    -- another column over time.-    | FieldAttrOther Text-    -- ^ A grab bag of random attributes that were unrecognized by the parser.+    = -- | The 'Maybe' keyword goes after the type. This indicates that the column+      -- is nullable, and the generated Haskell code will have a @'Maybe'@ type+      -- for it.+      --+      -- Example:+      --+      -- @+      -- User+      --     name Text Maybe+      -- @+      FieldAttrMaybe+    | -- | This indicates that the column is nullable, but should not have+      -- a 'Maybe' type. For this to work out, you need to ensure that the+      -- 'PersistField' instance for the type in question can support+      -- a 'PersistNull' value.+      --+      -- @+      -- data What = NoWhat | Hello Text+      --+      -- instance PersistField What where+      --     fromPersistValue PersistNull =+      --         pure NoWhat+      --     fromPersistValue pv =+      --         Hello <$> fromPersistValue pv+      --+      -- instance PersistFieldSql What where+      --     sqlType _ = SqlString+      --+      -- User+      --     what What nullable+      -- @+      FieldAttrNullable+    | -- | This tag means that the column will not be present on the Haskell code,+      -- but will not be removed from the database. Useful to deprecate fields in+      -- phases.+      --+      -- You should set the column to be nullable in the database. Otherwise,+      -- inserts won't have values.+      --+      -- @+      -- User+      --     oldName Text MigrationOnly+      --     newName Text+      -- @+      FieldAttrMigrationOnly+    | -- | A @SafeToRemove@ attribute is not present on the Haskell datatype, and+      -- the backend migrations should attempt to drop the column without+      -- triggering any unsafe migration warnings.+      --+      -- Useful after you've used @MigrationOnly@ to remove a column from the+      -- database in phases.+      --+      -- @+      -- User+      --     oldName Text SafeToRemove+      --     newName Text+      -- @+      FieldAttrSafeToRemove+    | -- | This attribute indicates that we should not create a foreign key+      -- reference from a column. By default, @persistent@ will try and create a+      -- foreign key reference for a column if it can determine that the type of+      -- the column is a @'Key' entity@ or an @EntityId@  and the @Entity@'s name+      -- was present in 'mkPersist'.+      --+      -- This is useful if you want to use the explicit foreign key syntax.+      --+      -- @+      -- Post+      --     title    Text+      --+      -- Comment+      --     postId   PostId      noreference+      --     Foreign Post fk_comment_post postId+      -- @+      FieldAttrNoreference+    | -- | This is set to specify precisely the database table the column refers+      -- to.+      --+      -- @+      -- Post+      --     title    Text+      --+      -- Comment+      --     postId   PostId references="post"+      -- @+      --+      -- You should not need this - @persistent@ should be capable of correctly+      -- determining the target table's name. If you do need this, please file an+      -- issue describing why.+      FieldAttrReference Text+    | -- | Specify a name for the constraint on the foreign key reference for this+      -- table.+      --+      -- @+      -- Post+      --     title    Text+      --+      -- Comment+      --     postId   PostId constraint="my_cool_constraint_name"+      -- @+      FieldAttrConstraint Text+    | -- | Specify the default value for a column.+      --+      -- @+      -- User+      --     createdAt    UTCTime     default="NOW()"+      -- @+      --+      -- Note that a @default=@ attribute does not mean you can omit the value+      -- while inserting.+      FieldAttrDefault Text+    | -- | Specify a custom SQL type for the column. Generally, you should define+      -- a custom datatype with a custom 'PersistFieldSql' instance instead of+      -- using this.+      --+      -- @+      -- User+      --     uuid     Text    sqltype="UUID"+      -- @+      FieldAttrSqltype Text+    | -- | Set a maximum length for a column. Useful for VARCHAR and indexes.+      --+      -- @+      -- User+      --     name     Text    maxlen=200+      --+      --     UniqueName name+      -- @+      FieldAttrMaxlen Integer+    | -- | Specify the database name of the column.+      --+      -- @+      -- User+      --     blarghle     Int     sql="b_l_a_r_g_h_l_e"+      -- @+      --+      -- Useful for performing phased migrations, where one column is renamed to+      -- another column over time.+      FieldAttrSql Text+    | -- | A grab bag of random attributes that were unrecognized by the parser.+      FieldAttrOther Text     deriving (Show, Eq, Read, Ord, Lift)  -- | Parse raw field attributes into structured form. Any unrecognized@@ -438,8 +443,8 @@ -- FTApp (FTTypeCon Nothing "Jsonb") (FTTypeCon Nothing "User") -- @ data FieldType-    = FTTypeCon (Maybe Text) Text-    -- ^ Optional module and name.+    = -- | Optional module and name.+      FTTypeCon (Maybe Text) Text     | FTLit FieldTypeLit     | FTTypePromoted Text     | FTApp FieldType FieldType@@ -460,12 +465,12 @@ -- 3) embedded data ReferenceDef     = NoReference-    | ForeignRef !EntityNameHS-    -- ^ A ForeignRef has a late binding to the EntityDef it references via name-    -- and has the Haskell type of the foreign key in the form of FieldType+    | -- | A ForeignRef has a late binding to the EntityDef it references via name+      -- and has the Haskell type of the foreign key in the form of FieldType+      ForeignRef !EntityNameHS     | EmbedRef EntityNameHS-    | SelfReference-    -- ^ A SelfReference stops an immediate cycle which causes non-termination at compile-time (issue #311).+    | -- | A SelfReference stops an immediate cycle which causes non-termination at compile-time (issue #311).+      SelfReference     deriving (Show, Eq, Read, Ord, Lift)  -- | An EmbedEntityDef is the same as an EntityDef@@ -473,14 +478,15 @@ -- so it only has data needed for embedding data EmbedEntityDef = EmbedEntityDef     { embeddedHaskell :: EntityNameHS-    , embeddedFields  :: [EmbedFieldDef]-    } deriving (Show, Eq, Read, Ord, Lift)+    , embeddedFields :: [EmbedFieldDef]+    }+    deriving (Show, Eq, Read, Ord, Lift)  -- | An EmbedFieldDef is the same as a FieldDef -- But it is only used for embeddedFields -- so it only has data needed for embedding data EmbedFieldDef = EmbedFieldDef-    { emFieldDB    :: FieldNameDB+    { emFieldDB :: FieldNameDB     , emFieldEmbed :: Maybe (Either SelfEmbed EntityNameHS)     }     deriving (Show, Eq, Read, Ord, Lift)@@ -494,19 +500,20 @@ -- @since 2.13.0.0 isHaskellField :: FieldDef -> Bool isHaskellField fd =-    FieldAttrMigrationOnly `notElem` fieldAttrs fd &&-    FieldAttrSafeToRemove `notElem` fieldAttrs fd+    FieldAttrMigrationOnly `notElem` fieldAttrs fd+        && FieldAttrSafeToRemove `notElem` fieldAttrs fd  toEmbedEntityDef :: EntityDef -> EmbedEntityDef toEmbedEntityDef ent = embDef   where-    embDef = EmbedEntityDef-        { embeddedHaskell = entityHaskell ent-        , embeddedFields =-            map toEmbedFieldDef-            $ filter isHaskellField-            $ entityFields ent-        }+    embDef =+        EmbedEntityDef+            { embeddedHaskell = entityHaskell ent+            , embeddedFields =+                map toEmbedFieldDef $+                    filter isHaskellField $+                        entityFields ent+            }     toEmbedFieldDef :: FieldDef -> EmbedFieldDef     toEmbedFieldDef field =         EmbedFieldDef@@ -540,18 +547,17 @@ --     , uniqueAttrs = [] --     } -- @--- data UniqueDef = UniqueDef     { uniqueHaskell :: !ConstraintNameHS-    , uniqueDBName  :: !ConstraintNameDB-    , uniqueFields  :: !(NonEmpty (FieldNameHS, FieldNameDB))-    , uniqueAttrs   :: ![Attr]+    , uniqueDBName :: !ConstraintNameDB+    , uniqueFields :: !(NonEmpty (FieldNameHS, FieldNameDB))+    , uniqueAttrs :: ![Attr]     }     deriving (Show, Eq, Read, Ord, Lift)  data CompositeDef = CompositeDef-    { compositeFields  :: !(NonEmpty FieldDef)-    , compositeAttrs   :: ![Attr]+    { compositeFields :: !(NonEmpty FieldDef)+    , compositeAttrs :: ![Attr]     }     deriving (Show, Eq, Read, Ord, Lift) @@ -560,18 +566,18 @@ type ForeignFieldDef = (FieldNameHS, FieldNameDB)  data ForeignDef = ForeignDef-    { foreignRefTableHaskell       :: !EntityNameHS-    , foreignRefTableDBName        :: !EntityNameDB+    { foreignRefTableHaskell :: !EntityNameHS+    , foreignRefTableDBName :: !EntityNameDB     , foreignConstraintNameHaskell :: !ConstraintNameHS-    , foreignConstraintNameDBName  :: !ConstraintNameDB-    , foreignFieldCascade          :: !FieldCascade+    , foreignConstraintNameDBName :: !ConstraintNameDB+    , foreignFieldCascade :: !FieldCascade     -- ^ Determine how the field will cascade on updates and deletions.     --     -- @since 2.11.0-    , foreignFields                :: ![(ForeignFieldDef, ForeignFieldDef)] -- this entity plus the primary entity-    , foreignAttrs                 :: ![Attr]-    , foreignNullable              :: Bool-    , foreignToPrimary             :: Bool+    , foreignFields :: ![(ForeignFieldDef, ForeignFieldDef)] -- this entity plus the primary entity+    , foreignAttrs :: ![Attr]+    , foreignNullable :: Bool+    , foreignToPrimary :: Bool     -- ^ Determines if the reference is towards a Primary Key or not.     --     -- @since 2.11.0@@ -614,7 +620,7 @@ -- change. -- -- @since 2.11.0-data CascadeAction = Cascade | Restrict | SetNull | SetDefault+data CascadeAction = Cascade | Restrict | SetNull | SetDefault | NoAction     deriving (Show, Eq, Read, Ord, Lift)  -- | Render a 'CascadeAction' to 'Text' such that it can be used in a SQL@@ -623,44 +629,58 @@ -- @since 2.11.0 renderCascadeAction :: CascadeAction -> Text renderCascadeAction action = case action of-  Cascade    -> "CASCADE"-  Restrict   -> "RESTRICT"-  SetNull    -> "SET NULL"-  SetDefault -> "SET DEFAULT"+    Cascade -> "CASCADE"+    Restrict -> "RESTRICT"+    SetNull -> "SET NULL"+    SetDefault -> "SET DEFAULT"+    NoAction -> "NO ACTION"  data PersistException-  = PersistError Text -- ^ Generic Exception-  | PersistMarshalError Text-  | PersistInvalidField Text-  | PersistForeignConstraintUnmet Text-  | PersistMongoDBError Text-  | PersistMongoDBUnsupported Text-    deriving Show+    = -- | Generic Exception+      PersistError Text+    | PersistMarshalError Text+    | PersistInvalidField Text+    | PersistForeignConstraintUnmet Text+    | PersistMongoDBError Text+    | PersistMongoDBUnsupported Text+    deriving (Show)  instance Exception PersistException  -- | A SQL data type. Naming attempts to reflect the underlying Haskell -- datatypes, eg SqlString instead of SqlVarchar. Different SQL databases may -- have different translations for these types.-data SqlType = SqlString-             | SqlInt32-             | SqlInt64-             | SqlReal-             | SqlNumeric Word32 Word32-             | SqlBool-             | SqlDay-             | SqlTime-             | SqlDayTime -- ^ Always uses UTC timezone-             | SqlBlob-             | SqlOther T.Text -- ^ a backend-specific name+data SqlType+    = SqlString+    | SqlInt32+    | SqlInt64+    | SqlReal+    | SqlNumeric Word32 Word32+    | SqlBool+    | SqlDay+    | SqlTime+    | -- | Always uses UTC timezone+      SqlDayTime+    | SqlBlob+    | -- | a backend-specific name+      SqlOther T.Text     deriving (Show, Read, Eq, Ord, Lift) -data PersistFilter = Eq | Ne | Gt | Lt | Ge | Le | In | NotIn-                   | BackendSpecificFilter T.Text+data PersistFilter+    = Eq+    | Ne+    | Gt+    | Lt+    | Ge+    | Le+    | In+    | NotIn+    | BackendSpecificFilter T.Text     deriving (Read, Show, Lift) -data UpdateException = KeyNotFound String-                     | UpsertError String+data UpdateException+    = KeyNotFound String+    | UpsertError String instance Show UpdateException where     show (KeyNotFound key) = "Key not found during updateGet: " ++ key     show (UpsertError msg) = "Error during upsert: " ++ msg@@ -669,12 +689,15 @@ data OnlyUniqueException = OnlyUniqueException String instance Show OnlyUniqueException where     show (OnlyUniqueException uniqueMsg) =-      "Expected only one unique key, got " ++ uniqueMsg+        "Expected only one unique key, got " ++ uniqueMsg instance Exception OnlyUniqueException - data PersistUpdate-    = Assign | Add | Subtract | Multiply | Divide+    = Assign+    | Add+    | Subtract+    | Multiply+    | Divide     | BackendSpecificUpdate T.Text     deriving (Read, Show, Lift) @@ -682,23 +705,23 @@ -- a field of a datatype. This includes information used to parse the field -- out of the database and what the field corresponds to. data FieldDef = FieldDef-    { fieldHaskell   :: !FieldNameHS+    { fieldHaskell :: !FieldNameHS     -- ^ The name of the field. Note that this does not corresponds to the     -- record labels generated for the particular entity - record labels     -- are generated with the type name prefixed to the field, so     -- a 'FieldDef' that contains a @'FieldNameHS' "name"@ for a type     -- @User@ will have a record field @userName@.-    , fieldDB        :: !FieldNameDB+    , fieldDB :: !FieldNameDB     -- ^ The name of the field in the database. For SQL databases, this     -- corresponds to the column name.-    , fieldType      :: !FieldType+    , fieldType :: !FieldType     -- ^ The type of the field in Haskell.-    , fieldSqlType   :: !SqlType+    , fieldSqlType :: !SqlType     -- ^ The type of the field in a SQL database.-    , fieldAttrs     :: ![FieldAttr]+    , fieldAttrs :: ![FieldAttr]     -- ^ User annotations for a field. These are provided with the @!@     -- operator.-    , fieldStrict    :: !Bool+    , fieldStrict :: !Bool     -- ^ If this is 'True', then the Haskell datatype will have a strict     -- record field. The default value for this is 'True'.     , fieldReference :: !ReferenceDef@@ -709,7 +732,7 @@     -- be the same as the one obtained in the 'fieldReference'.     --     -- @since 2.11.0-    , fieldComments  :: !(Maybe Text)+    , fieldComments :: !(Maybe Text)     -- ^ Optional comments for a 'Field'.     --     -- @since 2.10.0
bench/Main.hs view
@@ -1,7 +1,6 @@ {-# LANGUAGE BangPatterns #-} {-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-}- {-# OPTIONS_GHC -Wno-orphans #-}  module Main (main) where@@ -18,106 +17,89 @@ import Models  main :: IO ()-main = defaultMain-    [ bgroup "mkPersist"-        [ -- bench "From File" $ nfIO $ mkPersist' $(persistFileWith lowerCaseSettings "bench/models-slowly")-        -- , bgroup "Non-Null Fields"-        --    [ bgroup "Increasing model count"-        --        [ bench "1x10" $ nfIO $ mkPersist' $( parseReferencesQ (mkModels 10 10))-        --        , bench "10x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 10))-        --        , bench "100x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 100 10))-        --        -- , bench "1000x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 1000 10))-        --        ]-        --    , bgroup "Increasing field count"-        --        [ bench "10x1" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 1))-        --        , bench "10x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 10))-        --        , bench "10x100" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 100))-        --        -- , bench "10x1000" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 1000))-        --        ]-        --    ]-        -- , bgroup "Nullable"-        --    [ bgroup "Increasing model count"-        --        [ bench "20x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 20 10))-        --        , bench "40x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 40 10))-        --        , bench "60x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 60 10))-        --        , bench "80x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 80 10))-        --        , bench "100x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 100 10))-        --        -- , bench "1000x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 1000 10))-        --        ]-        --    , bgroup "Increasing field count"-        --        [ bench "10x20" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 20))-        --        , bench "10x40" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 40))-        --        , bench "10x60" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 60))-        --        , bench "10x80" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 80))-        --        , bench "10x100" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 100))-        --        -- , bench "10x1000" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 1000))-        --        ]-        --    ]+main =+    defaultMain+        [ bgroup+            "mkPersist"+            []         ]-    ] --- Orphan instances for NFData Template Haskell types-instance NFData Overlap where---instance NFData AnnTarget where--instance NFData RuleBndr where---instance NFData Role where---instance NFData Phases where---instance NFData InjectivityAnn where---instance NFData FamilyResultSig where---instance NFData RuleMatch where---instance NFData TypeFamilyHead where---instance NFData TySynEqn where---instance NFData Inline where+-- bench "From File" $ nfIO $ mkPersist' $(persistFileWith lowerCaseSettings "bench/models-slowly")+-- , bgroup "Non-Null Fields"+--    [ bgroup "Increasing model count"+--        [ bench "1x10" $ nfIO $ mkPersist' $( parseReferencesQ (mkModels 10 10))+--        , bench "10x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 10))+--        , bench "100x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 100 10))+--        -- , bench "1000x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 1000 10))+--        ]+--    , bgroup "Increasing field count"+--        [ bench "10x1" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 1))+--        , bench "10x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 10))+--        , bench "10x100" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 100))+--        -- , bench "10x1000" $ nfIO $ mkPersist' $(parseReferencesQ (mkModels 10 1000))+--        ]+--    ]+-- , bgroup "Nullable"+--    [ bgroup "Increasing model count"+--        [ bench "20x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 20 10))+--        , bench "40x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 40 10))+--        , bench "60x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 60 10))+--        , bench "80x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 80 10))+--        , bench "100x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 100 10))+--        -- , bench "1000x10" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 1000 10))+--        ]+--    , bgroup "Increasing field count"+--        [ bench "10x20" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 20))+--        , bench "10x40" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 40))+--        , bench "10x60" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 60))+--        , bench "10x80" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 80))+--        , bench "10x100" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 100))+--        -- , bench "10x1000" $ nfIO $ mkPersist' $(parseReferencesQ (mkNullableModels 10 1000))+--        ]+--    ] +-- Orphan instances for NFData Template Haskell types+instance NFData Overlap -instance NFData Pragma where+instance NFData AnnTarget +instance NFData RuleBndr -instance NFData FixityDirection where+instance NFData Role +instance NFData Phases -instance NFData Safety where+instance NFData InjectivityAnn +instance NFData FamilyResultSig -instance NFData Fixity where+instance NFData RuleMatch +instance NFData TypeFamilyHead -instance NFData Callconv where+instance NFData TySynEqn +instance NFData Inline -instance NFData Foreign where+instance NFData Pragma +instance NFData FixityDirection -instance NFData SourceStrictness where+instance NFData Safety +instance NFData Fixity -instance NFData SourceUnpackedness where+instance NFData Callconv +instance NFData Foreign -instance NFData FunDep where+instance NFData SourceStrictness +instance NFData SourceUnpackedness -instance NFData Bang where+instance NFData FunDep +instance NFData Bang  #if MIN_VERSION_template_haskell(2,12,0) instance NFData PatSynDir where@@ -140,43 +122,31 @@ instance NFData NamespaceSpecifier where #endif -instance NFData Con where---instance NFData Range where---instance NFData Clause where---instance NFData PkgName where---instance NFData Dec where---instance NFData Stmt where---instance NFData TyLit where+instance NFData Con +instance NFData Range -instance NFData NameSpace where+instance NFData Clause +instance NFData PkgName -instance NFData Body where+instance NFData Dec +instance NFData Stmt -instance NFData Guard where+instance NFData TyLit +instance NFData NameSpace -instance NFData Match where+instance NFData Body +instance NFData Guard -instance NFData ModName where+instance NFData Match +instance NFData ModName -instance NFData Pat where+instance NFData Pat  #if MIN_VERSION_template_haskell(2,16,0) instance NFData Bytes where@@ -192,19 +162,14 @@  #endif -instance NFData NameFlavour where---instance NFData Type where---instance NFData Exp where-+instance NFData NameFlavour -instance NFData Lit where+instance NFData Type -instance NFData OccName where+instance NFData Exp +instance NFData Lit -instance NFData Name where+instance NFData OccName +instance NFData Name
bench/Models.hs view
@@ -1,15 +1,16 @@ {-# LANGUAGE TupleSections #-}+ module Models where  import Data.Monoid-import Language.Haskell.TH import qualified Data.Text as Text+import Language.Haskell.TH  import Database.Persist.Quasi import Database.Persist.Quasi.Internal+import Database.Persist.Sql import Database.Persist.TH import Database.Persist.TH.Internal-import Database.Persist.Sql  -- TODO: we use lookupName and reify etc which breaks in IO. somehow need to -- test this out elsewise@@ -31,7 +32,7 @@  mkModelsWithFieldModifier :: (String -> String) -> Int -> Int -> String mkModelsWithFieldModifier k i f =-    unlines . fmap unlines . take i . map mkModel . zip [0..] . cycle $+    unlines . fmap unlines . take i . map mkModel . zip [0 ..] . cycle $         [ "Model"         , "Foobar"         , "User"@@ -49,13 +50,17 @@ indent i = map (replicate i ' ' ++)  mkFields :: Int -> [String]-mkFields i = take i $ map mkField $ zip [0..] $ cycle-    [ "Bool"-    , "Int"-    , "String"-    , "Double"-    , "Text"-    ]+mkFields i =+    take i $+        map mkField $+            zip [0 ..] $+                cycle+                    [ "Bool"+                    , "Int"+                    , "String"+                    , "Double"+                    , "Text"+                    ]   where     mkField :: (Int, String) -> String     mkField (i', typ) = "field" <> show i' <> "\t\t" <> typ
persistent.cabal view
@@ -1,5 +1,5 @@ name:               persistent-version:            2.17.1.0+version:            2.18.0.0 license:            MIT license-file:       LICENSE author:             Michael Snoyman <michael@snoyman.com>
test/Database/Persist/PersistValueSpec.hs view
@@ -1,16 +1,14 @@ module Database.Persist.PersistValueSpec where -import Test.Hspec-import Database.Persist.PersistValue-import Data.List.NonEmpty (NonEmpty(..), (<|))+import Data.Aeson+import qualified Data.ByteString.Char8 as BS8+import Data.List.NonEmpty (NonEmpty (..), (<|)) import qualified Data.Text as T+import Database.Persist.PersistValue import Test.Hspec import Test.Hspec.QuickCheck import Test.QuickCheck-import Data.Aeson-import qualified Data.ByteString.Char8 as BS8 - spec :: Spec spec = describe "PersistValueSpec" $ do     describe "PersistValue" $ do@@ -18,12 +16,10 @@             let                 testPrefix constr prefixChar bytes =                     takePrefix (toJSON (constr (BS8.pack bytes)))-                    ===-                    String (T.singleton prefixChar)+                        === String (T.singleton prefixChar)                 roundTrip constr bytes =                     fromJSON (toJSON (constr (BS8.pack bytes)))-                    ===-                    Data.Aeson.Success (constr (BS8.pack bytes))+                        === Data.Aeson.Success (constr (BS8.pack bytes))                 subject constr prefixChar = do                     prop ("encodes with a " ++ [prefixChar] ++ " prefix") $                         testPrefix constr prefixChar
test/Database/Persist/TH/CommentSpec.hs view
@@ -11,7 +11,6 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}- {-# OPTIONS_GHC -haddock #-}  module Database.Persist.TH.CommentSpec@@ -21,10 +20,12 @@  import TemplateTestImports -import Database.Persist.EntityDef.Internal (EntityDef(..))-import Database.Persist.FieldDef.Internal (FieldDef(..))+import Database.Persist.EntityDef.Internal (EntityDef (..))+import Database.Persist.FieldDef.Internal (FieldDef (..)) -mkPersist (sqlSettings {mpsEntityHaddocks = True}) [persistLowerCase|+mkPersist+    (sqlSettings{mpsEntityHaddocks = True})+    [persistLowerCase|  -- | Doc comments work. -- | Has multiple lines.@@ -51,10 +52,11 @@     it "has entity comments" $ do         entityComments ed             `shouldBe` do-                Just $ mconcat-                    [ "Doc comments work.\n"-                    , "Has multiple lines.\n"-                    ]+                Just $+                    mconcat+                        [ "Doc comments work.\n"+                        , "Has multiple lines.\n"+                        ]      describe "fieldComments" $ do         let@@ -63,7 +65,8 @@         it "has the right name comments" $ do             nameComments                 `shouldBe` do-                    Just $ mconcat-                        [ "First line of comment on column.\n"-                        , "Second line of comment on column.\n"-                        ]+                    Just $+                        mconcat+                            [ "First line of comment on column.\n"+                            , "Second line of comment on column.\n"+                            ]
test/Database/Persist/TH/CompositeKeyStyleSpec.hs view
@@ -9,7 +9,6 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-}- {-# OPTIONS_GHC -Wname-shadowing -Werror=name-shadowing #-}  module Database.Persist.TH.CompositeKeyStyleSpec where@@ -20,8 +19,9 @@ import Database.Persist.TH import Test.Hspec hiding (Selector) -mkPersist sqlSettings-  [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|     CompanyUserLegacyStyle       companyName Text       userName Text@@ -31,8 +31,9 @@ deriving instance Data CompanyUserLegacyStyle deriving instance Data (Key CompanyUserLegacyStyle) -mkPersist sqlSettings {mpsCamelCaseCompositeKeySelector = True}-  [persistLowerCase|+mkPersist+    sqlSettings{mpsCamelCaseCompositeKeySelector = True}+    [persistLowerCase|     CompanyUserCamelStyle       companyName Text       userName Text@@ -44,21 +45,21 @@  spec :: Spec spec = describe "CompositeKeyStyleSpec" $ do-  describe "mpsCamelCaseCompositeKeySelector is False" $ do-    it "Should generate Legacy style key selectors" $ do-      let key = CompanyUserLegacyStyleKey "cName" "uName"+    describe "mpsCamelCaseCompositeKeySelector is False" $ do+        it "Should generate Legacy style key selectors" $ do+            let+                key = CompanyUserLegacyStyleKey "cName" "uName" -      constrFields (toConstr key)-        `shouldBe`-          [ "companyUserLegacyStyleKeycompanyName"-          , "companyUserLegacyStyleKeyuserName"-          ]-  describe "mpsCamelCaseCompositeKeySelector is True" $ do-    it "Should generate CamelCase style key selectors" $ do-      let key = CompanyUserCamelStyleKey "cName" "uName"+            constrFields (toConstr key)+                `shouldBe` [ "companyUserLegacyStyleKeycompanyName"+                           , "companyUserLegacyStyleKeyuserName"+                           ]+    describe "mpsCamelCaseCompositeKeySelector is True" $ do+        it "Should generate CamelCase style key selectors" $ do+            let+                key = CompanyUserCamelStyleKey "cName" "uName" -      constrFields (toConstr key)-        `shouldBe`-          [ "companyUserCamelStyleKeyCompanyName"-          , "companyUserCamelStyleKeyUserName"-          ]+            constrFields (toConstr key)+                `shouldBe` [ "companyUserCamelStyleKeyCompanyName"+                           , "companyUserCamelStyleKeyUserName"+                           ]
test/Database/Persist/TH/DiscoverEntitiesSpec.hs view
@@ -25,7 +25,9 @@ import Database.Persist.ImplicitIdDef import Database.Persist.ImplicitIdDef.Internal (fieldTypeFromTypeable) -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  User     name    String@@ -51,10 +53,11 @@  spec :: Spec spec = describe "DiscoverEntitiesSpec" $ do-    let entities = $(discoverEntities)+    let+        entities = $(discoverEntities)     it "should have all three entities" $ do-        entities `shouldMatchList`-            [ entityDef $ Proxy @User-            , entityDef $ Proxy @Dog-            , entityDef $ Proxy @Cat-            ]+        entities+            `shouldMatchList` [ entityDef $ Proxy @User+                              , entityDef $ Proxy @Dog+                              , entityDef $ Proxy @Cat+                              ]
test/Database/Persist/TH/EmbedSpec.hs view
@@ -16,18 +16,19 @@  import TemplateTestImports -import Data.Text (Text) import qualified Data.Map as M+import Data.Text (Text) import qualified Data.Text as T +import Database.Persist.EntityDef+import Database.Persist.EntityDef.Internal (toEmbedEntityDef) import Database.Persist.ImplicitIdDef import Database.Persist.ImplicitIdDef.Internal (fieldTypeFromTypeable) import Database.Persist.Types-import Database.Persist.Types-import Database.Persist.EntityDef-import Database.Persist.EntityDef.Internal (toEmbedEntityDef) -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  Thing     name String@@ -80,12 +81,10 @@                 getEntityFields edef         it "has the right type" $ do             fieldType fieldDef-                `shouldBe`-                    FTList (FTTypeCon Nothing "Text")+                `shouldBe` FTList (FTTypeCon Nothing "Text")         it "has the right sqltype" $ do             fieldSqlType fieldDef-                `shouldBe`-                    SqlString+                `shouldBe` SqlString     describe "MapIdValue" $ do         let             edef =@@ -94,20 +93,15 @@                 getEntityFields edef         it "has the right type" $ do             fieldType fieldDef-                `shouldBe`-                    ( FTTypeCon (Just "M") "Map"-                        `FTApp`-                        FTTypeCon (Just "T") "Text"-                        `FTApp`-                        (FTTypeCon Nothing "Key"-                            `FTApp`-                            FTTypeCon Nothing "Thing"-                        )-                    )+                `shouldBe` ( FTTypeCon (Just "M") "Map"+                                `FTApp` FTTypeCon (Just "T") "Text"+                                `FTApp` ( FTTypeCon Nothing "Key"+                                            `FTApp` FTTypeCon Nothing "Thing"+                                        )+                           )         it "has the right sqltype" $ do             fieldSqlType fieldDef-                `shouldBe`-                    SqlString+                `shouldBe` SqlString     describe "HasMap" $ do         let             edef =@@ -116,17 +110,13 @@                 getEntityFields edef         it "has the right type" $ do             fieldType fieldDef-                `shouldBe`-                    ( FTTypeCon (Just "M") "Map"-                    `FTApp`-                    FTTypeCon (Just "T") "Text"-                    `FTApp`-                    FTTypeCon (Just "T") "Text"-                    )+                `shouldBe` ( FTTypeCon (Just "M") "Map"+                                `FTApp` FTTypeCon (Just "T") "Text"+                                `FTApp` FTTypeCon (Just "T") "Text"+                           )         it "has the right sqltype" $ do             fieldSqlType fieldDef-                `shouldBe`-                    SqlString+                `shouldBe` SqlString      describe "SomeThing" $ do         let@@ -138,12 +128,12 @@                     toEmbedEntityDef edef             it "should have the same field count as Haskell fields" $ do                 length (embeddedFields embedDef)-                    `shouldBe`-                        length (getEntityFields edef)+                    `shouldBe` length (getEntityFields edef)      describe "EmbedThing" $ do         it "generates the right constructor" $ do-            let embedThing :: EmbedThing+            let+                embedThing :: EmbedThing                 embedThing = EmbedThing (Thing "asdf")             pass @@ -156,14 +146,11 @@                 [nameField, selfField] = getEntityFields edef             it "has self reference" $ do                 fieldReference selfField-                    `shouldBe`-                        NoReference+                    `shouldBe` NoReference         describe "toEmbedEntityDef" $ do             let                 embedDef =                     toEmbedEntityDef edef             it "has the same field count as regular def" $ do                 length (getEntityFields edef)-                    `shouldBe`-                        length (embeddedFields embedDef)-+                    `shouldBe` length (embeddedFields embedDef)
test/Database/Persist/TH/ForeignRefSpec.hs view
@@ -81,6 +81,14 @@     name Text     parent ParentImplicitId OnDeleteCascade OnUpdateCascade +ChildImplicitUnspecified+    name Text+    parent ParentImplicitId++ChildImplicitNoAction+    name Text+    parent ParentImplicitId OnDeleteNoAction OnUpdateNoAction+ ParentExplicit     name Text     Primary name@@ -88,6 +96,14 @@ ChildExplicit     name Text     Foreign ParentExplicit OnDeleteCascade OnUpdateCascade fkparent name++ChildExplicitNoAction+    name Text+    Foreign ParentExplicit OnDeleteNoAction OnUpdateNoAction fkparent name++ChildExplicitUnspecified+    name Text+    Foreign ParentExplicit fkparent name |]  spec :: Spec@@ -113,6 +129,106 @@             foreignPrimarySourceFk_name_target (ForeignPrimarySource "asdf")                 `shouldBe` ForeignPrimaryKey "asdf" +    describe "Unspecified" $ do+        describe "Explicit" $ do+            let+                parentDef =+                    entityDef $ Proxy @ParentExplicit+                childDef =+                    entityDef $ Proxy @ChildExplicitUnspecified+                childForeigns =+                    entityForeigns childDef+            it "should have a single foreign reference defined" $ do+                case entityForeigns childDef of+                    [ForeignDef{..}] ->+                        foreignFieldCascade+                            `shouldBe` FieldCascade+                                { fcOnUpdate = Nothing+                                , fcOnDelete = Nothing+                                }+                    as ->+                        expectationFailure . mconcat $+                            [ "(Explicit) Expected one foreign reference on childDef, "+                            , "got: "+                            , show as+                            ]++        describe "Implicit" $ do+            let+                parentDef =+                    entityDef $ Proxy @ParentImplicit+                childDef =+                    entityDef $ Proxy @ChildImplicitUnspecified+                childFields =+                    entityFields childDef+            describe "ChildImplicitUnspecified" $ do+                case childFields of+                    [nameField, parentIdField] -> do+                        it "parentId has reference" $ do+                            fieldReference parentIdField+                                `shouldBe` ForeignRef (EntityNameHS "ParentImplicit")+                            fieldCascade parentIdField+                                `shouldBe` FieldCascade+                                    { fcOnUpdate = Nothing+                                    , fcOnDelete = Nothing+                                    }+                    as ->+                        error . mconcat $+                            [ "(Implicit) Expected one foreign reference on childDef, "+                            , "got: "+                            , show as+                            ]++    describe "NoAction" $ do+        describe "Explicit" $ do+            let+                parentDef =+                    entityDef $ Proxy @ParentExplicit+                childDef =+                    entityDef $ Proxy @ChildExplicitNoAction+                childForeigns =+                    entityForeigns childDef+            it "should have a single foreign reference defined" $ do+                case entityForeigns childDef of+                    [ForeignDef{..}] ->+                        foreignFieldCascade+                            `shouldBe` FieldCascade+                                { fcOnUpdate = Just NoAction+                                , fcOnDelete = Just NoAction+                                }+                    as ->+                        expectationFailure . mconcat $+                            [ "(Explicit) Expected one foreign reference on childDef, "+                            , "got: "+                            , show as+                            ]++        describe "Implicit" $ do+            let+                parentDef =+                    entityDef $ Proxy @ParentImplicit+                childDef =+                    entityDef $ Proxy @ChildImplicitNoAction+                childFields =+                    entityFields childDef+            describe "ChildImplicitNoAction" $ do+                case childFields of+                    [nameField, parentIdField] -> do+                        it "parentId has reference" $ do+                            fieldReference parentIdField+                                `shouldBe` ForeignRef (EntityNameHS "ParentImplicit")+                            fieldCascade parentIdField+                                `shouldBe` FieldCascade+                                    { fcOnUpdate = Just NoAction+                                    , fcOnDelete = Just NoAction+                                    }+                    as ->+                        error . mconcat $+                            [ "(Implicit) Expected one foreign reference on childDef, "+                            , "got: "+                            , show as+                            ]+     describe "Cascade" $ do         describe "Explicit" $ do             let@@ -124,8 +240,12 @@                     entityForeigns childDef             it "should have a single foreign reference defined" $ do                 case entityForeigns childDef of-                    [a] ->-                        pure ()+                    [ForeignDef{..}] ->+                        foreignFieldCascade+                            `shouldBe` FieldCascade+                                { fcOnUpdate = Just Cascade+                                , fcOnDelete = Just Cascade+                                }                     as ->                         expectationFailure . mconcat $                             [ "(Explicit) Expected one foreign reference on childDef, "@@ -169,6 +289,11 @@                         it "parentId has reference" $ do                             fieldReference parentIdField                                 `shouldBe` ForeignRef (EntityNameHS "ParentImplicit")+                            fieldCascade parentIdField+                                `shouldBe` FieldCascade+                                    { fcOnUpdate = Just Cascade+                                    , fcOnDelete = Just Cascade+                                    }                     as ->                         error . mconcat $                             [ "(Implicit) Expected one foreign reference on childDef, "
test/Database/Persist/TH/ImplicitIdColSpec.hs view
@@ -24,11 +24,13 @@ do     let         uuidDef =-           mkImplicitIdDef @Text "uuid_generate_v1mc()"+            mkImplicitIdDef @Text "uuid_generate_v1mc()"         settings =             setImplicitIdDef uuidDef sqlSettings -    mkPersist settings [persistLowerCase|+    mkPersist+        settings+        [persistLowerCase|          User             name    String@@ -60,5 +62,4 @@         it "has Text FieldType" $ asIO $ do             pendingWith "currently returns UserId, may not be an issue"             fieldType idField-                `shouldBe`-                    fieldTypeFromTypeable @Text+                `shouldBe` fieldTypeFromTypeable @Text
test/Database/Persist/TH/JsonEncodingSpec.hs view
@@ -29,7 +29,9 @@ import Database.Persist.ImplicitIdDef.Internal (fieldTypeFromTypeable) import Database.Persist.Types -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| JsonEncoding json     name Text     age  Int@@ -71,58 +73,54 @@      it "encodes without an ID field" $ do         toJSON subjectEntity-            `shouldBe`-                object-                    [ ("name", String "Bob")-                    , ("age", toJSON (32 :: Int))-                    , ("id", String "Bob")-                    ]--    it "decodes without an ID field" $ do-        let-            json_ = encode . object $+            `shouldBe` object                 [ ("name", String "Bob")                 , ("age", toJSON (32 :: Int))+                , ("id", String "Bob")                 ]++    it "decodes without an ID field" $ do+        let+            json_ =+                encode . object $+                    [ ("name", String "Bob")+                    , ("age", toJSON (32 :: Int))+                    ]         eitherDecode json_-            `shouldBe`-                Right subjectEntity+            `shouldBe` Right subjectEntity      it "has informative decoder errors" $ do         let             json_ = encode Null         (eitherDecode json_ :: Either String JsonEncoding)-            `shouldBe`-                Left "Error in $: parsing JsonEncoding failed, expected Object, but encountered Null"+            `shouldBe` Left+                "Error in $: parsing JsonEncoding failed, expected Object, but encountered Null"      prop "works with a Primary" $ \jsonEncoding -> do         let             ent =                 Entity (JsonEncodingKey (jsonEncodingName jsonEncoding)) jsonEncoding         decode (encode ent)-            `shouldBe`-                Just ent+            `shouldBe` Just ent      prop "excuse me what" $ \j@JsonEncoding{..} -> do         let             ent =                 Entity (JsonEncodingKey jsonEncodingName) j         toJSON ent-            `shouldBe`-                object-                    [ ("name", toJSON jsonEncodingName)-                    , ("age", toJSON jsonEncodingAge)-                    , ("id", toJSON jsonEncodingName)-                    ]+            `shouldBe` object+                [ ("name", toJSON jsonEncodingName)+                , ("age", toJSON jsonEncodingAge)+                , ("id", toJSON jsonEncodingName)+                ]      prop "round trip works with composite key" $ \j@JsonEncoding2{..} -> do         let             key = JsonEncoding2Key jsonEncoding2Name jsonEncoding2Blood             ent =-              Entity key j+                Entity key j         decode (encode ent)-            `shouldBe`-                Just ent+            `shouldBe` Just ent      prop "works with a composite key" $ \j@JsonEncoding2{..} -> do         let@@ -130,10 +128,9 @@             ent =                 Entity key j         toJSON ent-            `shouldBe`-                object-                  [ ("name", toJSON jsonEncoding2Name)-                  , ("age", toJSON jsonEncoding2Age)-                  , ("blood", toJSON jsonEncoding2Blood)-                  , ("id", toJSON key)-                  ]+            `shouldBe` object+                [ ("name", toJSON jsonEncoding2Name)+                , ("age", toJSON jsonEncoding2Age)+                , ("blood", toJSON jsonEncoding2Blood)+                , ("id", toJSON key)+                ]
test/Database/Persist/TH/KindEntitiesSpec.hs view
@@ -14,7 +14,9 @@ import Database.Persist.TH.KindEntitiesSpecImports import TemplateTestImports -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  Customer     name    String@@ -28,7 +30,9 @@ spec :: Spec spec = describe "KindEntities" $ do     it "should support DataKinds in entity definition" $ do-        let mkTransfer :: CustomerId -> MoneyAmount 'CustomerOwned 'Debit -> CustomerTransfer+        let+            mkTransfer+                :: CustomerId -> MoneyAmount 'CustomerOwned 'Debit -> CustomerTransfer             mkTransfer = CustomerTransfer             getAmount :: CustomerTransfer -> MoneyAmount 'CustomerOwned 'Debit             getAmount = customerTransferMoneyAmount
test/Database/Persist/TH/MaybeFieldDefsSpec.hs view
@@ -13,7 +13,9 @@  import TemplateTestImports -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| Account     name    (Maybe String)     email   String@@ -22,7 +24,8 @@ spec :: Spec spec = describe "MaybeFieldDefs" $ do     it "should support literal `Maybe` declaration in entity definition" $ do-        let mkAccount :: Maybe String -> String -> Account+        let+            mkAccount :: Maybe String -> String -> Account             mkAccount = Account         compiles 
test/Database/Persist/TH/MigrationOnlySpec.hs view
@@ -22,7 +22,9 @@ import Database.Persist.ImplicitIdDef.Internal (fieldTypeFromTypeable) import Database.Persist.Types -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  HasMigrationOnly     name String@@ -54,12 +56,8 @@         describe "toPersistFields" $ do             it "should have one field" $ do                 map toPersistValue (toPersistFields (HasMigrationOnly "asdf"))-                    `shouldBe`-                        [PersistText ("asdf" :: Text)]+                    `shouldBe` [PersistText ("asdf" :: Text)]         describe "fromPersistValues" $ do             it "should work with only item in list" $ do                 fromPersistValues [PersistText "Hello"]-                    `shouldBe`-                        Right (HasMigrationOnly "Hello")--+                    `shouldBe` Right (HasMigrationOnly "Hello")
test/Database/Persist/TH/MultiBlockSpec.hs view
@@ -18,7 +18,6 @@  import TemplateTestImports - import Database.Persist.TH.MultiBlockSpec.Model  share@@ -56,24 +55,20 @@                     getEntityFields edef             it "User reference works" $ do                 fieldReference userRef-                    `shouldBe`-                        ForeignRef-                            (EntityNameHS "User")+                    `shouldBe` ForeignRef+                        (EntityNameHS "User")              it "Primary key reference works" $ do                 fieldReference profileRef-                    `shouldBe`-                        ForeignRef-                            (EntityNameHS "MBDog")+                    `shouldBe` ForeignRef+                        (EntityNameHS "MBDog")              it "Thing ref works (same block)" $ do                 fieldReference thingRef-                    `shouldBe`-                        ForeignRef-                            (EntityNameHS "Thing")+                    `shouldBe` ForeignRef+                        (EntityNameHS "Thing")              it "ThingAuto ref works (same block)" $ do                 fieldReference thingAutoRef-                    `shouldBe`-                        ForeignRef-                            (EntityNameHS "ThingAuto")+                    `shouldBe` ForeignRef+                        (EntityNameHS "ThingAuto")
test/Database/Persist/TH/MultiBlockSpec/Model.hs view
@@ -1,5 +1,5 @@-{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}@@ -42,4 +42,3 @@     Primary name age  |]-
test/Database/Persist/TH/NestedSymbolsInTypeSpec.hs view
@@ -1,4 +1,3 @@-{-# OPTIONS_GHC -Wno-unused-local-binds #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE FlexibleInstances #-}@@ -9,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-}+{-# OPTIONS_GHC -Wno-unused-local-binds #-}  module Database.Persist.TH.NestedSymbolsInTypeSpec where @@ -16,7 +16,9 @@ import Database.Persist.TH.NestedSymbolsInTypeSpecImports import TemplateTestImports -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| PathEntitySimple     readOnly  (Maybe (SomePath ReadOnly)) @@ -27,16 +29,19 @@ spec :: Spec spec = describe "NestedSymbolsInType" $ do     it "should support nested parens" $ do-        let mkPathEntitySimple :: Maybe (SomePath ReadOnly) -> PathEntitySimple+        let+            mkPathEntitySimple :: Maybe (SomePath ReadOnly) -> PathEntitySimple             mkPathEntitySimple = PathEntitySimple             pathEntitySimpleReadOnly' :: PathEntitySimple -> Maybe (SomePath ReadOnly)             pathEntitySimpleReadOnly' = pathEntitySimpleReadOnly         compiles      it "should support deeply nested parens + square brackets" $ do-        let mkPathEntityNested :: Maybe (Map Text [SomePath ReadWrite]) -> PathEntityNested+        let+            mkPathEntityNested :: Maybe (Map Text [SomePath ReadWrite]) -> PathEntityNested             mkPathEntityNested = PathEntityNested-            pathEntityNestedPaths' :: PathEntityNested -> Maybe (Map Text [SomePath ReadWrite])+            pathEntityNestedPaths'+                :: PathEntityNested -> Maybe (Map Text [SomePath ReadWrite])             pathEntityNestedPaths' = pathEntityNestedPaths         compiles 
test/Database/Persist/TH/NoFieldSelectorsSpec.hs view
@@ -3,15 +3,15 @@ {-# LANGUAGE NoFieldSelectors #-} {-# LANGUAGE DuplicateRecordFields #-} #endif-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE GADTs #-}+{-# LANGUAGE DataKinds #-} {-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleInstances #-}  module Database.Persist.TH.NoFieldSelectorsSpec where 
test/Database/Persist/TH/OverloadedLabelSpec.hs view
@@ -12,14 +12,15 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}- {-# OPTIONS_GHC -Wname-shadowing -Werror=name-shadowing #-}  module Database.Persist.TH.OverloadedLabelSpec where  import TemplateTestImports -mkPersist sqlSettings [persistUpperCase|+mkPersist+    sqlSettings+    [persistUpperCase|  User     name    String@@ -42,14 +43,16 @@ spec :: Spec spec = describe "OverloadedLabels" $ do     it "works for monomorphic labels" $ do-        let UserName = #name+        let+            UserName = #name             OrganizationName = #name             DogName = #name          compiles      it "works for polymorphic labels" $ do-        let name :: _ => EntityField rec a+        let+            name :: (_) => EntityField rec a             name = #name              UserName = name@@ -59,13 +62,15 @@         compiles      it "works for id labels" $ do-        let UserId = #id+        let+            UserId = #id             orgId = #id :: EntityField Organization OrganizationId          compiles      it "works for Primary labels" $ do-        let StudentId = #id+        let+            StudentId = #id             studentId = #id :: EntityField Student StudentId          compiles
test/Database/Persist/TH/PersistWith/Model.hs view
@@ -18,7 +18,10 @@  import Database.Persist.TH.PersistWith.Model2 as Model2 -mkPersistWith sqlSettings $(discoverEntities) [persistLowerCase|+mkPersistWith+    sqlSettings+    $(discoverEntities)+    [persistLowerCase|  IceCream     flavor  FlavorId
test/Database/Persist/TH/PersistWith/Model2.hs view
@@ -16,7 +16,9 @@  import TemplateTestImports -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  Flavor     name    Text
test/Database/Persist/TH/PersistWithSpec.hs view
@@ -1,8 +1,8 @@ {-# LANGUAGE DataKinds #-}-{-# LANGUAGE GADTs #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-}@@ -16,11 +16,14 @@ module Database.Persist.TH.PersistWithSpec where  import Control.Monad-import TemplateTestImports import Database.Persist.TH.PersistWith.Model as Model (IceCream, IceCreamId) import Language.Haskell.TH as TH+import TemplateTestImports -mkPersistWith sqlSettings $(discoverEntities) [persistLowerCase|+mkPersistWith+    sqlSettings+    $(discoverEntities)+    [persistLowerCase|  BestTopping     iceCream IceCreamId@@ -62,11 +65,17 @@ shouldReferToIceCream :: EntityField BestTopping a -> IO () shouldReferToIceCream field =     unless (reference == iceCreamRef) $ do-        expectationFailure $ mconcat-            [ "The field '", show field, "' does not have a reference to IceCream.\n"-            , "Got Reference: ", show reference, "\n"-            , "Expected     : ", show iceCreamRef-            ]+        expectationFailure $+            mconcat+                [ "The field '"+                , show field+                , "' does not have a reference to IceCream.\n"+                , "Got Reference: "+                , show reference+                , "\n"+                , "Expected     : "+                , show iceCreamRef+                ]   where     reference =         fieldReference (persistFieldDef field)
test/Database/Persist/TH/RequireOnlyPersistImportSpec.hs view
@@ -18,7 +18,9 @@ -- always explicitly import qualified Hspec in the context of this spec import qualified Test.Hspec as HS -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| Plain     name String     age  Int@@ -34,12 +36,14 @@ spec =     HS.describe "RequireOnlyPersistImport" $ do         HS.it "Plain" $ do-            let typeSigPlain :: String -> Int -> Plain+            let+                typeSigPlain :: String -> Int -> Plain                 typeSigPlain = Plain             compiles          HS.it "JsonEncoded" $ do-            let typeSigJsonEncoded :: String -> Int -> JsonEncoded+            let+                typeSigJsonEncoded :: String -> Int -> JsonEncoded                 typeSigJsonEncoded = JsonEncoded             compiles 
test/Database/Persist/TH/SharedPrimaryKeyImportedSpec.hs view
@@ -1,32 +1,37 @@-{-# LANGUAGE TypeApplications, DeriveGeneric #-}-{-# LANGUAGE DataKinds, ExistentialQuantification #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE DerivingStrategies #-}-{-# LANGUAGE StandaloneDeriving #-}  module Database.Persist.TH.SharedPrimaryKeyImportedSpec where  import TemplateTestImports +import Control.Monad.IO.Class import Data.Proxy-import Test.Hspec import Database.Persist import Database.Persist.Sql import Database.Persist.Sql.Util import Database.Persist.TH import Language.Haskell.TH-import Control.Monad.IO.Class+import Test.Hspec  import Database.Persist.TH.SharedPrimaryKeySpec (User, UserId) -mkPersistWith sqlSettings $(discoverEntities) [persistLowerCase|+mkPersistWith+    sqlSettings+    $(discoverEntities)+    [persistLowerCase|  ProfileX     Id      UserId@@ -39,17 +44,15 @@ -- module. spec :: Spec spec = describe "Shared Primary Keys Imported" $ do-     describe "PersistFieldSql" $ do         it "should match underlying key" $ do             sqlType (Proxy @UserId)-                `shouldBe`-                    sqlType (Proxy @ProfileXId)+                `shouldBe` sqlType (Proxy @ProfileXId)      describe "getEntityId FieldDef" $ do         it "should match underlying primary key" $ do             let-                getSqlType :: PersistEntity a => Proxy a -> SqlType+                getSqlType :: (PersistEntity a) => Proxy a -> SqlType                 getSqlType p =                     case getEntityId (entityDef p) of                         EntityIdField fd ->@@ -57,9 +60,7 @@                         _ ->                             SqlOther "Composite Key"             getSqlType (Proxy @User)-                `shouldBe`-                    getSqlType (Proxy @ProfileX)-+                `shouldBe` getSqlType (Proxy @ProfileX)      describe "foreign reference should work" $ do         it "should have a foreign reference" $ do@@ -68,5 +69,4 @@                 Just fd =                     getEntityIdField (entityDef (Proxy @ProfileX))             fieldReference fd-                `shouldBe`-                    ForeignRef (EntityNameHS "User")+                `shouldBe` ForeignRef (EntityNameHS "User")
test/Database/Persist/TH/SharedPrimaryKeySpec.hs view
@@ -1,30 +1,34 @@-{-# LANGUAGE TypeApplications, DeriveGeneric #-}+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE ExistentialQuantification #-}-{-# LANGUAGE DataKinds, FlexibleInstances #-}+{-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE DerivingStrategies #-}-{-# LANGUAGE StandaloneDeriving #-}  module Database.Persist.TH.SharedPrimaryKeySpec where  import TemplateTestImports -import Data.Time import Data.Proxy-import Test.Hspec+import Data.Time import Database.Persist import Database.Persist.EntityDef import Database.Persist.Sql import Database.Persist.Sql.Util import Database.Persist.TH+import Test.Hspec -share [ mkPersist sqlSettings ] [persistLowerCase|+share+    [mkPersist sqlSettings]+    [persistLowerCase|  User     name    String@@ -49,7 +53,7 @@ spec :: Spec spec = describe "Shared Primary Keys" $ do     let-        getSqlType :: PersistEntity a => Proxy a -> SqlType+        getSqlType :: (PersistEntity a) => Proxy a -> SqlType         getSqlType p =             case getEntityId (entityDef p) of                 EntityIdField fd ->@@ -77,49 +81,42 @@     describe "PersistFieldSql" $ do         it "should match underlying key" $ do             sqlType (Proxy @UserId)-                `shouldBe`-                    sqlType (Proxy @ProfileId)+                `shouldBe` sqlType (Proxy @ProfileId)      describe "User" $ do         it "has default ID key, SqlInt64" $ do             sqlType (Proxy @UserId)-                `shouldBe`-                    SqlInt64+                `shouldBe` SqlInt64          testSqlTypeEquivalent (Proxy @User) -    describe "Profile"  $ do+    describe "Profile" $ do         it "has same ID key type as User" $ do             sqlType (Proxy @ProfileId)-                `shouldBe`-                    sqlType (Proxy @UserId)-        testSqlTypeEquivalent(Proxy @Profile)+                `shouldBe` sqlType (Proxy @UserId)+        testSqlTypeEquivalent (Proxy @Profile)      describe "Profile2" $ do         it "has same ID key type as User" $ do             sqlType (Proxy @Profile2Id)-                `shouldBe`-                    sqlType (Proxy @UserId)+                `shouldBe` sqlType (Proxy @UserId)         testSqlTypeEquivalent (Proxy @Profile2)      describe "getEntityId FieldDef" $ do         it "should match underlying primary key" $ do             getSqlType (Proxy @User)-                `shouldBe`-                    getSqlType (Proxy @Profile)+                `shouldBe` getSqlType (Proxy @Profile)      describe "DayKeyTable" $ do         testSqlTypeEquivalent (Proxy @DayKeyTable)          it "sqlType has Day type" $ do             sqlType (Proxy @Day)-                `shouldBe`-                    sqlType (Proxy @DayKeyTableId)+                `shouldBe` sqlType (Proxy @DayKeyTableId)          it "getSqlType has Day type" $ do             sqlType (Proxy @Day)-                `shouldBe`-                    getSqlType (Proxy @DayKeyTable)+                `shouldBe` getSqlType (Proxy @DayKeyTable)      describe "RefDayKey" $ do         let@@ -129,13 +126,11 @@          it "has same sqltype as underlying" $ do             fieldSqlType dayKeyField-                `shouldBe`-                    sqlType (Proxy @Day)+                `shouldBe` sqlType (Proxy @Day)          it "has the right fieldType" $ do             fieldType dayKeyField-                `shouldBe`-                    FTTypeCon Nothing "DayKeyTableId"+                `shouldBe` FTTypeCon Nothing "DayKeyTableId"          it "has the right type" $ do             let
test/Database/Persist/TH/SumSpec.hs view
@@ -18,7 +18,6 @@  import TemplateTestImports - import Database.Persist.TH.MultiBlockSpec.Model  share@@ -40,4 +39,3 @@ spec :: Spec spec = do     it "should warn" True-
test/Database/Persist/TH/ToFromPersistValuesSpec.hs view
@@ -1,4 +1,11 @@-{-# LANGUAGE DataKinds, ScopedTypeVariables #-}+{-# LANGUAGE DataKinds #-}+--+-- DeriveAnyClass is not actually used by persistent-template+-- But a long standing bug was that if it was enabled, it was used to derive instead of GeneralizedNewtypeDeriving+-- This was fixed by using DerivingStrategies to specify newtype deriving should be used.+-- This pragma is left here as a "test" that deriving works when DeriveAnyClass is enabled.+-- See https://github.com/yesodweb/persistent/issues/578+{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE ExistentialQuantification #-}@@ -8,40 +15,36 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}------ DeriveAnyClass is not actually used by persistent-template--- But a long standing bug was that if it was enabled, it was used to derive instead of GeneralizedNewtypeDeriving--- This was fixed by using DerivingStrategies to specify newtype deriving should be used.--- This pragma is left here as a "test" that deriving works when DeriveAnyClass is enabled.--- See https://github.com/yesodweb/persistent/issues/578-{-# LANGUAGE DeriveAnyClass #-}  module Database.Persist.TH.ToFromPersistValuesSpec where  import TemplateTestImports -import Database.Persist.Sql.Util-import Database.Persist.Class.PersistEntity-import Data.List.NonEmpty (NonEmpty(..))+import Data.List.NonEmpty (NonEmpty (..)) import qualified Data.List.NonEmpty as NEL+import Database.Persist.Class.PersistEntity+import Database.Persist.Sql.Util -instance PersistFieldSql a => PersistFieldSql (NonEmpty a) where+instance (PersistFieldSql a) => PersistFieldSql (NonEmpty a) where     sqlType _ = SqlString -instance PersistField a => PersistField (NonEmpty a) where+instance (PersistField a) => PersistField (NonEmpty a) where     toPersistValue = toPersistValue . NEL.toList     fromPersistValue pv = do         xs <- fromPersistValue pv         case xs of             [] -> Left "PersistField: NonEmpty found unexpected Empty List"-            (l:ls) -> Right (l:|ls)+            (l : ls) -> Right (l :| ls) -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase|  NormalModel     name Text@@ -77,7 +80,7 @@ spec = describe "{to,from}PersistValues" $ do     let         toPersistValues-            :: PersistEntity rec => rec -> [PersistValue]+            :: (PersistEntity rec) => rec -> [PersistValue]         toPersistValues =             map toPersistValue . toPersistFields @@ -89,12 +92,10 @@         subject model fields = do             it "toPersistValues" $ do                 toPersistValues model-                    `shouldBe`-                        fields+                    `shouldBe` fields             it "fromPersistValues" $ do                 fromPersistValues fields-                    `shouldBe`-                        Right model+                    `shouldBe` Right model     describe "NormalModel" $ do         subject             (NormalModel "hello" 30)@@ -120,36 +121,33 @@         describe "NormalModel" $ do             it "has all values" $ do                 mkInsertValues (NormalModel "hello" 30)-                    `shouldBe`-                        [ PersistText "hello"-                        , PersistInt64 30-                        ]+                    `shouldBe` [ PersistText "hello"+                               , PersistInt64 30+                               ]         describe "PrimaryModel" $ do             it "has all values" $ do                 mkInsertValues (PrimaryModel "hello" 30)-                    `shouldBe`-                        [ PersistText "hello"-                        , PersistInt64 30-                        ]+                    `shouldBe` [ PersistText "hello"+                               , PersistInt64 30+                               ]         describe "IsMigrationOnly" $ do             it "has all values" $ do                 mkInsertValues (IsMigrationOnly "hello" 30)-                    `shouldBe`-                        [ PersistText "hello"-                        , PersistInt64 30-                        ]+                    `shouldBe` [ PersistText "hello"+                               , PersistInt64 30+                               ]     describe "parseEntityValues" $ do         let             subject-                :: forall rec. (PersistEntity rec, Show rec, Eq rec)+                :: forall rec+                 . (PersistEntity rec, Show rec, Eq rec)                 => [PersistValue]                 -> Entity rec                 -> Spec             subject pvs rec =                 it "parses" $ do                     parseEntityValues (entityDef (Proxy @rec)) pvs-                        `shouldBe`-                            Right rec+                        `shouldBe` Right rec         describe "NormalModel" $ do             subject                 [ PersistInt64 20@@ -188,21 +186,20 @@     describe "entityValues" $ do         let             subject-                :: forall rec. (PersistEntity rec, Show rec, Eq rec)+                :: forall rec+                 . (PersistEntity rec, Show rec, Eq rec)                 => [PersistValue]                 -> Entity rec                 -> Spec             subject pvals entity = do-                it "renders as you would expect"$ do+                it "renders as you would expect" $ do                     entityValues entity-                        `shouldBe`-                            pvals+                        `shouldBe` pvals                 it "round trips with parseEntityValues" $ do                     parseEntityValues                         (entityDef $ Proxy @rec)                         (entityValues entity)-                        `shouldBe`-                            Right entity+                        `shouldBe` Right entity         describe "NormalModel" $ do             subject                 [ PersistInt64 10
test/Database/Persist/TH/TypeLitFieldDefsSpec.hs view
@@ -33,7 +33,9 @@ instance PersistFieldSql (Labelled n) where     sqlType _ = sqlType (Proxy :: Proxy Int) -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| WithFinite     one    (Finite 1)     twenty (Finite 20)@@ -46,12 +48,14 @@ spec :: Spec spec = describe "TypeLitFieldDefs" $ do     it "should support numeric type literal fields in entity definition" $ do-        let mkFinite :: Finite 1 -> Finite 20 -> WithFinite+        let+            mkFinite :: Finite 1 -> Finite 20 -> WithFinite             mkFinite = WithFinite         compiles      it "should support string based type literal fields in entity definition" $ do-        let mkLabelled :: Labelled "one" -> Labelled "twenty" -> WithLabelled+        let+            mkLabelled :: Labelled "one" -> Labelled "twenty" -> WithLabelled             mkLabelled = WithLabelled         compiles 
test/Database/Persist/THSpec.hs view
@@ -1,4 +1,11 @@ {-# LANGUAGE DataKinds #-}+--+-- DeriveAnyClass is not actually used by persistent-template+-- But a long standing bug was that if it was enabled, it was used to derive instead of GeneralizedNewtypeDeriving+-- This was fixed by using DerivingStrategies to specify newtype deriving should be used.+-- This pragma is left here as a "test" that deriving works when DeriveAnyClass is enabled.+-- See https://github.com/yesodweb/persistent/issues/578+{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE ExistentialQuantification #-}@@ -14,21 +21,14 @@ {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE UndecidableInstances #-}------ DeriveAnyClass is not actually used by persistent-template--- But a long standing bug was that if it was enabled, it was used to derive instead of GeneralizedNewtypeDeriving--- This was fixed by using DerivingStrategies to specify newtype deriving should be used.--- This pragma is left here as a "test" that deriving works when DeriveAnyClass is enabled.--- See https://github.com/yesodweb/persistent/issues/578-{-# LANGUAGE DeriveAnyClass #-}  module Database.Persist.THSpec where -import Control.Applicative (Const(..))+import Control.Applicative (Const (..)) import Data.Aeson (decode, encode) import Data.ByteString.Lazy.Char8 () import Data.Coerce-import Data.Functor.Identity (Identity(..))+import Data.Functor.Identity (Identity (..)) import Data.Int import qualified Data.List as List import Data.Proxy@@ -44,11 +44,11 @@  import Database.Persist import Database.Persist.EntityDef.Internal-import Database.Persist.Quasi.Internal (SourceLoc(..), sourceLocFromTHLoc)-import Database.Persist.Types.SourceSpan+import Database.Persist.Quasi.Internal (SourceLoc (..), sourceLocFromTHLoc) import Database.Persist.Sql import Database.Persist.Sql.Util import Database.Persist.TH+import Database.Persist.Types.SourceSpan import TemplateTestImports  import qualified Database.Persist.TH.CommentSpec as CommentSpec@@ -82,8 +82,14 @@ -- Used to test TH definition positions are plausible. personDefBeforeLoc :: SourceLoc personDefBeforeLoc = $(TH.lift . sourceLocFromTHLoc =<< TH.location)-share [mkPersistWith  sqlSettings { mpsGeneric = False, mpsDeriveInstances = [''Generic] } [entityDef @JsonEncodingSpec.JsonEncoding Proxy]] [persistUpperCase| +share+    [ mkPersistWith+        sqlSettings{mpsGeneric = False, mpsDeriveInstances = [''Generic]}+        [entityDef @JsonEncodingSpec.JsonEncoding Proxy]+    ]+    [persistUpperCase|+ Person json     name Text     age Int Maybe@@ -113,12 +119,15 @@     jsonEncoding JsonEncodingSpec.JsonEncodingId  |]+ -- | Location after the block defining Person above. Must be after it. Do not move! -- Used to test TH definition positions are plausible. personDefAfterLoc :: SourceLoc personDefAfterLoc = $(TH.lift . sourceLocFromTHLoc =<< TH.location) -mkPersist sqlSettings [persistLowerCase|+mkPersist+    sqlSettings+    [persistLowerCase| HasPrimaryDef     userId Int     name String@@ -173,7 +182,9 @@  |] -share [mkPersist sqlSettings { mpsGeneric = False, mpsGenerateLenses = True }] [persistLowerCase|+share+    [mkPersist sqlSettings{mpsGeneric = False, mpsGenerateLenses = True}]+    [persistLowerCase| Lperson json     name Text     age Int Maybe@@ -222,14 +233,16 @@     EntityHaddockSpec.spec     CompositeKeyStyleSpec.spec     it "QualifiedReference" $ do-        let ed = entityDef @QualifiedReference Proxy-            [FieldDef {..}] = entityFields ed+        let+            ed = entityDef @QualifiedReference Proxy+            [FieldDef{..}] = entityFields ed         fieldType `shouldBe` FTTypeCon (Just "JsonEncodingSpec") "JsonEncodingId"         fieldSqlType `shouldBe` sqlType @JsonEncodingSpec.JsonEncodingId Proxy         fieldReference `shouldBe` ForeignRef (EntityNameHS "JsonEncoding")      describe "TestDefaultKeyCol" $ do-        let EntityIdField FieldDef{..} =+        let+            EntityIdField FieldDef{..} =                 entityId (entityDef (Proxy @TestDefaultKeyCol))         it "should be a BackendKey SqlBackend" $ do             -- the purpose of this test is to verify that a custom Id column of@@ -239,10 +252,10 @@             --             -- should behave like an implicit id column.             (TestDefaultKeyColKey (SqlBackendKey 32) :: Key TestDefaultKeyCol)-                `shouldBe`-                    (toSqlKey 32 :: Key TestDefaultKeyCol)+                `shouldBe` (toSqlKey 32 :: Key TestDefaultKeyCol)     describe "HasDefaultId" $ do-        let EntityIdField FieldDef{..} =+        let+            EntityIdField FieldDef{..} =                 entityId (entityDef (Proxy @HasDefaultId))         it "should have usual db name" $ do             fieldDB `shouldBe` FieldNameDB "id"@@ -256,7 +269,8 @@             fieldType `shouldBe` FTTypeCon Nothing "HasDefaultIdId"      describe "HasCustomSqlId" $ do-        let EntityIdField FieldDef{..} =+        let+            EntityIdField FieldDef{..} =                 entityId (entityDef (Proxy @HasCustomSqlId))         it "should have custom db name" $ do             fieldDB `shouldBe` FieldNameDB "my_id"@@ -267,7 +281,8 @@         it "should have correct haskell type" $ do             fieldType `shouldBe` FTTypeCon Nothing "String"     describe "HasIdDef" $ do-        let EntityIdField FieldDef{..} =+        let+            EntityIdField FieldDef{..} =                 entityId (entityDef (Proxy @HasIdDef))         it "should have usual db name" $ do             fieldDB `shouldBe` FieldNameDB "id"@@ -279,7 +294,8 @@             fieldType `shouldBe` FTTypeCon Nothing "Int"      describe "SharedPrimaryKey" $ do-        let sharedDef = entityDef (Proxy @SharedPrimaryKey)+        let+            sharedDef = entityDef (Proxy @SharedPrimaryKey)             EntityIdField FieldDef{..} =                 entityId sharedDef         it "should have usual db name" $ do@@ -294,19 +310,17 @@             fieldType `shouldBe` (FTTypeCon Nothing "HasDefaultIdId")         it "should have correct sql type from PersistFieldSql" $ do             sqlType (Proxy @SharedPrimaryKeyId)-                `shouldBe`-                    SqlInt64+                `shouldBe` SqlInt64         it "should have same sqlType as underlying record" $ do             sqlType (Proxy @SharedPrimaryKeyId)-                `shouldBe`-                    sqlType (Proxy @HasDefaultIdId)+                `shouldBe` sqlType (Proxy @HasDefaultIdId)         it "should be a coercible newtype" $ do             coerce @Int64 3-                `shouldBe`-                    SharedPrimaryKeyKey (toSqlKey 3)+                `shouldBe` SharedPrimaryKeyKey (toSqlKey 3)      describe "SharedPrimaryKeyWithCascade" $ do-        let EntityIdField FieldDef{..} =+        let+            EntityIdField FieldDef{..} =                 entityId (entityDef (Proxy @SharedPrimaryKeyWithCascade))         it "should have usual db name" $ do             fieldDB `shouldBe` FieldNameDB "id"@@ -316,17 +330,17 @@             fieldSqlType `shouldBe` SqlInt64         it "should have correct haskell type" $ do             fieldType-                `shouldBe`-                    FTApp (FTTypeCon Nothing "Key") (FTTypeCon Nothing "HasDefaultId")+                `shouldBe` FTApp (FTTypeCon Nothing "Key") (FTTypeCon Nothing "HasDefaultId")         it "should have cascade in field def" $ do-            fieldCascade `shouldBe` noCascade { fcOnDelete = Just Cascade }+            fieldCascade `shouldBe` noCascade{fcOnDelete = Just Cascade}      describe "OnCascadeDelete" $ do-        let subject :: FieldDef+        let+            subject :: FieldDef             Just subject =-                List.find ((FieldNameHS "person" ==) . fieldHaskell)-                $ entityFields-                $ simpleCascadeDef+                List.find ((FieldNameHS "person" ==) . fieldHaskell) $+                    entityFields $+                        simpleCascadeDef             simpleCascadeDef =                 entityDef (Proxy :: Proxy HasSimpleCascadeRef)             expected =@@ -336,18 +350,19 @@                     }         describe "entityDef" $ do             it "correct position" $ do-                let Just theSpan = entitySpan simpleCascadeDef+                let+                    Just theSpan = entitySpan simpleCascadeDef                 theSpan `shouldSatisfy` ((> locStartLine personDefBeforeLoc) . spanStartLine)                 theSpan `shouldSatisfy` (\s -> spanStartLine s < spanEndLine s)                 theSpan `shouldSatisfy` ((< locStartLine personDefAfterLoc) . spanEndLine)             it "works" $ do                 simpleCascadeDef-                    `shouldBe`-                        EntityDef-                            { entityHaskell = EntityNameHS "HasSimpleCascadeRef"-                            , entityDB = EntityNameDB "HasSimpleCascadeRef"-                            , entityId =-                                EntityIdField FieldDef+                    `shouldBe` EntityDef+                        { entityHaskell = EntityNameHS "HasSimpleCascadeRef"+                        , entityDB = EntityNameDB "HasSimpleCascadeRef"+                        , entityId =+                            EntityIdField+                                FieldDef                                     { fieldHaskell = FieldNameHS "Id"                                     , fieldDB = FieldNameDB "id"                                     , fieldType = FTTypeCon Nothing "HasSimpleCascadeRefId"@@ -361,97 +376,96 @@                                     , fieldGenerated = Nothing                                     , fieldIsImplicitIdColumn = True                                     }-                            , entityAttrs = []-                            , entityFields =-                                [ FieldDef-                                    { fieldHaskell = FieldNameHS "person"-                                    , fieldDB = FieldNameDB "person"-                                    , fieldType = FTTypeCon Nothing "PersonId"-                                    , fieldSqlType = SqlInt64-                                    , fieldAttrs = []-                                    , fieldStrict = True-                                    , fieldReference =-                                        ForeignRef-                                            (EntityNameHS "Person")-                                    , fieldCascade =-                                        FieldCascade { fcOnUpdate = Nothing, fcOnDelete = Just Cascade }-                                    , fieldComments = Nothing-                                    , fieldGenerated = Nothing-                                    , fieldIsImplicitIdColumn = False-                                    }-                                ]-                            , entityUniques = []-                            , entityForeigns = []-                            , entityDerives =  ["Show", "Eq"]-                            , entityExtra = mempty-                            , entitySum = False-                            , entityComments = Nothing-                            -- We cannot test this is a precise value without-                            -- being really fragile, but we have another test to-                            -- verify the line is in range.-                            , entitySpan = entitySpan simpleCascadeDef-                            }+                        , entityAttrs = []+                        , entityFields =+                            [ FieldDef+                                { fieldHaskell = FieldNameHS "person"+                                , fieldDB = FieldNameDB "person"+                                , fieldType = FTTypeCon Nothing "PersonId"+                                , fieldSqlType = SqlInt64+                                , fieldAttrs = []+                                , fieldStrict = True+                                , fieldReference =+                                    ForeignRef+                                        (EntityNameHS "Person")+                                , fieldCascade =+                                    FieldCascade{fcOnUpdate = Nothing, fcOnDelete = Just Cascade}+                                , fieldComments = Nothing+                                , fieldGenerated = Nothing+                                , fieldIsImplicitIdColumn = False+                                }+                            ]+                        , entityUniques = []+                        , entityForeigns = []+                        , entityDerives = ["Show", "Eq"]+                        , entityExtra = mempty+                        , entitySum = False+                        , entityComments = Nothing+                        , -- We cannot test this is a precise value without+                          -- being really fragile, but we have another test to+                          -- verify the line is in range.+                          entitySpan = entitySpan simpleCascadeDef+                        }         it "has the cascade on the field def" $ do             fieldCascade subject `shouldBe` expected         it "doesn't have any extras" $ do             entityExtra simpleCascadeDef-                `shouldBe`-                    mempty+                `shouldBe` mempty      describe "hasNaturalKey" $ do-        let subject :: PersistEntity a => Proxy a -> Bool+        let+            subject :: (PersistEntity a) => Proxy a -> Bool             subject p = hasNaturalKey (entityDef p)         it "is True for Primary keyword" $ do             subject (Proxy @HasPrimaryDef)-                `shouldBe`-                    True+                `shouldBe` True         it "is True for multiple Primary columns " $ do             subject (Proxy @HasMultipleColPrimaryDef)-                `shouldBe`-                    True+                `shouldBe` True         it "is False for Id keyword" $ do             subject (Proxy @HasIdDef)-                `shouldBe`-                    False+                `shouldBe` False         it "is False for unspecified/default id" $ do             subject (Proxy @HasDefaultId)-                `shouldBe`-                    False+                `shouldBe` False     describe "hasCompositePrimaryKey" $ do-        let subject :: PersistEntity a => Proxy a -> Bool+        let+            subject :: (PersistEntity a) => Proxy a -> Bool             subject p = hasCompositePrimaryKey (entityDef p)         it "is False for Primary with single column" $ do             subject (Proxy @HasPrimaryDef)-                `shouldBe`-                    False+                `shouldBe` False         it "is True for multiple Primary columns " $ do             subject (Proxy @HasMultipleColPrimaryDef)-                `shouldBe`-                    True+                `shouldBe` True         it "is False for Id keyword" $ do             subject (Proxy @HasIdDef)-                `shouldBe`-                    False+                `shouldBe` False         it "is False for unspecified/default id" $ do             subject (Proxy @HasDefaultId)-                `shouldBe`-                    False+                `shouldBe` False      describe "JSON serialization" $ do         prop "to/from is idempotent" $ \person ->             decode (encode person) == Just (person :: Person)         it "decode" $-            decode "{\"name\":\"Michael\",\"age\":27,\"foo\":\"Bar\",\"address\":{\"street\":\"Narkis\",\"city\":\"Maalot\"}}" `shouldBe` Just-                (Person "Michael" (Just 27) Bar $ Address "Narkis" "Maalot" Nothing)+            decode+                "{\"name\":\"Michael\",\"age\":27,\"foo\":\"Bar\",\"address\":{\"street\":\"Narkis\",\"city\":\"Maalot\"}}"+                `shouldBe` Just+                    (Person "Michael" (Just 27) Bar $ Address "Narkis" "Maalot" Nothing)     describe "JSON serialization for Entity" $ do-        let key = PersonKey 0+        let+            key = PersonKey 0         prop "to/from is idempotent" $ \person ->             decode (encode (Entity key person)) == Just (Entity key (person :: Person))         it "decode" $-            decode "{\"id\": 0, \"name\":\"Michael\",\"age\":27,\"foo\":\"Bar\",\"address\":{\"street\":\"Narkis\",\"city\":\"Maalot\"}}" `shouldBe` Just-                (Entity key (Person "Michael" (Just 27) Bar $ Address "Narkis" "Maalot" Nothing))+            decode+                "{\"id\": 0, \"name\":\"Michael\",\"age\":27,\"foo\":\"Bar\",\"address\":{\"street\":\"Narkis\",\"city\":\"Maalot\"}}"+                `shouldBe` Just+                    (Entity key (Person "Michael" (Just 27) Bar $ Address "Narkis" "Maalot" Nothing))     it "lens operations" $ do-        let street1 = "street1"+        let+            street1 = "street1"             city1 = "city1"             city2 = "city2"             zip1 = Just 12345@@ -466,12 +480,16 @@         (person1 & ((lpersonAddress . laddressCity) .~ city2)) `shouldBe` person2     describe "Derived Show/Read instances" $ do         -- This tests confirms https://github.com/yesodweb/persistent/issues/1104 remains fixed-        it "includes the name of the newtype when showing/reading a Key, i.e. uses the stock strategy when deriving Show/Read" $ do-            show (PersonKey 0) `shouldBe` "PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 0}}"-            read (show (PersonKey 0)) `shouldBe` PersonKey 0+        it+            "includes the name of the newtype when showing/reading a Key, i.e. uses the stock strategy when deriving Show/Read"+            $ do+                show (PersonKey 0)+                    `shouldBe` "PersonKey {unPersonKey = SqlBackendKey {unSqlBackendKey = 0}}"+                read (show (PersonKey 0)) `shouldBe` PersonKey 0 -            show (CustomPrimaryKeyKey 0) `shouldBe` "CustomPrimaryKeyKey {unCustomPrimaryKeyKey = 0}"-            read (show (CustomPrimaryKeyKey 0)) `shouldBe` CustomPrimaryKeyKey 0+                show (CustomPrimaryKeyKey 0)+                    `shouldBe` "CustomPrimaryKeyKey {unCustomPrimaryKeyKey = 0}"+                read (show (CustomPrimaryKeyKey 0)) `shouldBe` CustomPrimaryKeyKey 0      describe "tabulateEntityA" $ do         it "works" $ do@@ -486,20 +504,25 @@                         _ <- lookupEnv "PERSON_FOO" :: IO (Maybe String)                         pure Bar                     PersonAddress ->-                        pure $ Address  "lol no" "Denver" Nothing+                        pure $ Address "lol no" "Denver" Nothing                     PersonId ->                         pure $ toSqlKey 123-            expectedAge <- fromInteger . subtract 1988 . (\(a, _, _) -> a) . toGregorian . utctDay <$> getCurrentTime-            person `shouldBe` Entity (toSqlKey 123) Person-                { personName =-                    "Matt"-                , personAge =-                    Just expectedAge-                , personFoo =-                    Bar-                , personAddress =-                    Address  "lol no" "Denver" Nothing-                }+            expectedAge <-+                fromInteger . subtract 1988 . (\(a, _, _) -> a) . toGregorian . utctDay+                    <$> getCurrentTime+            person+                `shouldBe` Entity+                    (toSqlKey 123)+                    Person+                        { personName =+                            "Matt"+                        , personAge =+                            Just expectedAge+                        , personFoo =+                            Bar+                        , personAddress =+                            Address "lol no" "Denver" Nothing+                        }      describe "tabulateEntity" $ do         it "works" $ do@@ -514,28 +537,33 @@                             "Denver"                         AddressZip ->                             Nothing-            addressTabulate `shouldBe`-                Entity (toSqlKey 123) Address-                    { addressStreet = "nope"-                    , addressCity = "Denver"-                    , addressZip = Nothing-                    }+            addressTabulate+                `shouldBe` Entity+                    (toSqlKey 123)+                    Address+                        { addressStreet = "nope"+                        , addressCity = "Denver"+                        , addressZip = Nothing+                        }      describe "CustomIdName" $ do         it "has a good safe to insert class instance" $ do-            let proxy = Proxy :: SafeToInsert CustomIdName => Proxy CustomIdName+            let+                proxy = Proxy :: (SafeToInsert CustomIdName) => Proxy CustomIdName             proxy `shouldBe` Proxy  (&) :: a -> (a -> b) -> b x & f = f x -(^.) :: s-     -> ((a -> Const a b) -> (s -> Const a t))-     -> a+(^.)+    :: s+    -> ((a -> Const a b) -> (s -> Const a t))+    -> a x ^. lens = getConst $ lens Const x -(.~) :: ((a -> Identity b) -> (s -> Identity t))-     -> b-     -> s-     -> t+(.~)+    :: ((a -> Identity b) -> (s -> Identity t))+    -> b+    -> s+    -> t lens .~ val = runIdentity . lens (\_ -> Identity val)
test/TemplateTestImports.hs view
@@ -10,15 +10,15 @@ import Data.Aeson.TH import Test.QuickCheck +import Control.Monad import Data.Int as X-import Database.Persist.Sql as X-import Database.Persist.TH as X-import Test.Hspec as X+import Data.Maybe import Data.Proxy as X import Data.Text as X (Text)-import Data.Maybe-import Control.Monad+import Database.Persist.Sql as X+import Database.Persist.TH as X import Language.Haskell.TH.Syntax+import Test.Hspec as X  data Foo = Bar | Baz     deriving (Show, Eq)