    {-# LANGUAGE DeriveLift #-}

    -- | This module contains types and functions for working with and
    -- disambiguating database and Haskell names.
    --
    -- @since 2.13.0.0
    module Database.Persist.Names where

    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 ()

    -- | Convenience operations for working with '-NameDB' types.
    --
    -- @since 2.12.0.0
    class DatabaseName a where
        escapeWith :: (Text -> str) -> (a -> str)

    -- | A 'FieldNameDB' represents the datastore-side name that @persistent@
    -- will use for a field.
    --
    -- @since 2.12.0.0
    newtype FieldNameDB = FieldNameDB { FieldNameDB -> Text
    unFieldNameDB :: Text }
        deriving (Int -> FieldNameDB -> ShowS
    [FieldNameDB] -> ShowS
    FieldNameDB -> String
    (Int -> FieldNameDB -> ShowS)
    -> (FieldNameDB -> String)
    -> ([FieldNameDB] -> ShowS)
    -> Show FieldNameDB
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FieldNameDB -> ShowS
    showsPrec :: Int -> FieldNameDB -> ShowS
    $cshow :: FieldNameDB -> String
    show :: FieldNameDB -> String
    $cshowList :: [FieldNameDB] -> ShowS
    showList :: [FieldNameDB] -> ShowS
    Show, FieldNameDB -> FieldNameDB -> Bool
    (FieldNameDB -> FieldNameDB -> Bool)
    -> (FieldNameDB -> FieldNameDB -> Bool) -> Eq FieldNameDB
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FieldNameDB -> FieldNameDB -> Bool
    == :: FieldNameDB -> FieldNameDB -> Bool
    $c/= :: FieldNameDB -> FieldNameDB -> Bool
    /= :: FieldNameDB -> FieldNameDB -> Bool
    Eq, ReadPrec [FieldNameDB]
    ReadPrec FieldNameDB
    Int -> ReadS FieldNameDB
    ReadS [FieldNameDB]
    (Int -> ReadS FieldNameDB)
    -> ReadS [FieldNameDB]
    -> ReadPrec FieldNameDB
    -> ReadPrec [FieldNameDB]
    -> Read FieldNameDB
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS FieldNameDB
    readsPrec :: Int -> ReadS FieldNameDB
    $creadList :: ReadS [FieldNameDB]
    readList :: ReadS [FieldNameDB]
    $creadPrec :: ReadPrec FieldNameDB
    readPrec :: ReadPrec FieldNameDB
    $creadListPrec :: ReadPrec [FieldNameDB]
    readListPrec :: ReadPrec [FieldNameDB]
    Read, Eq FieldNameDB
    Eq FieldNameDB =>
    (FieldNameDB -> FieldNameDB -> Ordering)
    -> (FieldNameDB -> FieldNameDB -> Bool)
    -> (FieldNameDB -> FieldNameDB -> Bool)
    -> (FieldNameDB -> FieldNameDB -> Bool)
    -> (FieldNameDB -> FieldNameDB -> Bool)
    -> (FieldNameDB -> FieldNameDB -> FieldNameDB)
    -> (FieldNameDB -> FieldNameDB -> FieldNameDB)
    -> Ord FieldNameDB
    FieldNameDB -> FieldNameDB -> Bool
    FieldNameDB -> FieldNameDB -> Ordering
    FieldNameDB -> FieldNameDB -> FieldNameDB
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: FieldNameDB -> FieldNameDB -> Ordering
    compare :: FieldNameDB -> FieldNameDB -> Ordering
    $c< :: FieldNameDB -> FieldNameDB -> Bool
    < :: FieldNameDB -> FieldNameDB -> Bool
    $c<= :: FieldNameDB -> FieldNameDB -> Bool
    <= :: FieldNameDB -> FieldNameDB -> Bool
    $c> :: FieldNameDB -> FieldNameDB -> Bool
    > :: FieldNameDB -> FieldNameDB -> Bool
    $c>= :: FieldNameDB -> FieldNameDB -> Bool
    >= :: FieldNameDB -> FieldNameDB -> Bool
    $cmax :: FieldNameDB -> FieldNameDB -> FieldNameDB
    max :: FieldNameDB -> FieldNameDB -> FieldNameDB
    $cmin :: FieldNameDB -> FieldNameDB -> FieldNameDB
    min :: FieldNameDB -> FieldNameDB -> FieldNameDB
    Ord, (forall (m :: * -> *). Quote m => FieldNameDB -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        FieldNameDB -> Code m FieldNameDB)
    -> Lift FieldNameDB
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => FieldNameDB -> m Exp
    forall (m :: * -> *). Quote m => FieldNameDB -> Code m FieldNameDB
    $clift :: forall (m :: * -> *). Quote m => FieldNameDB -> m Exp
    lift :: forall (m :: * -> *). Quote m => FieldNameDB -> m Exp
    $cliftTyped :: forall (m :: * -> *). Quote m => FieldNameDB -> Code m FieldNameDB
    liftTyped :: forall (m :: * -> *). Quote m => FieldNameDB -> Code m FieldNameDB
    Lift)

    -- | @since 2.12.0.0
    instance DatabaseName FieldNameDB where
        escapeWith :: forall str. (Text -> str) -> FieldNameDB -> str
    escapeWith Text -> str
    f (FieldNameDB Text
    n) = Text -> str
    f Text
    n

    -- | A 'FieldNameHS' represents the Haskell-side name that @persistent@
    -- will use for a field.
    --
    -- @since 2.12.0.0
    newtype FieldNameHS = FieldNameHS { FieldNameHS -> Text
    unFieldNameHS :: Text }
        deriving (Int -> FieldNameHS -> ShowS
    [FieldNameHS] -> ShowS
    FieldNameHS -> String
    (Int -> FieldNameHS -> ShowS)
    -> (FieldNameHS -> String)
    -> ([FieldNameHS] -> ShowS)
    -> Show FieldNameHS
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FieldNameHS -> ShowS
    showsPrec :: Int -> FieldNameHS -> ShowS
    $cshow :: FieldNameHS -> String
    show :: FieldNameHS -> String
    $cshowList :: [FieldNameHS] -> ShowS
    showList :: [FieldNameHS] -> ShowS
    Show, FieldNameHS -> FieldNameHS -> Bool
    (FieldNameHS -> FieldNameHS -> Bool)
    -> (FieldNameHS -> FieldNameHS -> Bool) -> Eq FieldNameHS
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FieldNameHS -> FieldNameHS -> Bool
    == :: FieldNameHS -> FieldNameHS -> Bool
    $c/= :: FieldNameHS -> FieldNameHS -> Bool
    /= :: FieldNameHS -> FieldNameHS -> Bool
    Eq, ReadPrec [FieldNameHS]
    ReadPrec FieldNameHS
    Int -> ReadS FieldNameHS
    ReadS [FieldNameHS]
    (Int -> ReadS FieldNameHS)
    -> ReadS [FieldNameHS]
    -> ReadPrec FieldNameHS
    -> ReadPrec [FieldNameHS]
    -> Read FieldNameHS
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS FieldNameHS
    readsPrec :: Int -> ReadS FieldNameHS
    $creadList :: ReadS [FieldNameHS]
    readList :: ReadS [FieldNameHS]
    $creadPrec :: ReadPrec FieldNameHS
    readPrec :: ReadPrec FieldNameHS
    $creadListPrec :: ReadPrec [FieldNameHS]
    readListPrec :: ReadPrec [FieldNameHS]
    Read, Eq FieldNameHS
    Eq FieldNameHS =>
    (FieldNameHS -> FieldNameHS -> Ordering)
    -> (FieldNameHS -> FieldNameHS -> Bool)
    -> (FieldNameHS -> FieldNameHS -> Bool)
    -> (FieldNameHS -> FieldNameHS -> Bool)
    -> (FieldNameHS -> FieldNameHS -> Bool)
    -> (FieldNameHS -> FieldNameHS -> FieldNameHS)
    -> (FieldNameHS -> FieldNameHS -> FieldNameHS)
    -> Ord FieldNameHS
    FieldNameHS -> FieldNameHS -> Bool
    FieldNameHS -> FieldNameHS -> Ordering
    FieldNameHS -> FieldNameHS -> FieldNameHS
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: FieldNameHS -> FieldNameHS -> Ordering
    compare :: FieldNameHS -> FieldNameHS -> Ordering
    $c< :: FieldNameHS -> FieldNameHS -> Bool
    < :: FieldNameHS -> FieldNameHS -> Bool
    $c<= :: FieldNameHS -> FieldNameHS -> Bool
    <= :: FieldNameHS -> FieldNameHS -> Bool
    $c> :: FieldNameHS -> FieldNameHS -> Bool
    > :: FieldNameHS -> FieldNameHS -> Bool
    $c>= :: FieldNameHS -> FieldNameHS -> Bool
    >= :: FieldNameHS -> FieldNameHS -> Bool
    $cmax :: FieldNameHS -> FieldNameHS -> FieldNameHS
    max :: FieldNameHS -> FieldNameHS -> FieldNameHS
    $cmin :: FieldNameHS -> FieldNameHS -> FieldNameHS
    min :: FieldNameHS -> FieldNameHS -> FieldNameHS
    Ord, (forall (m :: * -> *). Quote m => FieldNameHS -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        FieldNameHS -> Code m FieldNameHS)
    -> Lift FieldNameHS
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => FieldNameHS -> m Exp
    forall (m :: * -> *). Quote m => FieldNameHS -> Code m FieldNameHS
    $clift :: forall (m :: * -> *). Quote m => FieldNameHS -> m Exp
    lift :: forall (m :: * -> *). Quote m => FieldNameHS -> m Exp
    $cliftTyped :: forall (m :: * -> *). Quote m => FieldNameHS -> Code m FieldNameHS
    liftTyped :: forall (m :: * -> *). Quote m => FieldNameHS -> Code m FieldNameHS
    Lift)

    -- | An 'EntityNameHS' represents the Haskell-side name that @persistent@
    -- will use for an entity.
    --
    -- @since 2.12.0.0
    newtype EntityNameHS = EntityNameHS { EntityNameHS -> Text
    unEntityNameHS :: Text }
        deriving (Int -> EntityNameHS -> ShowS
    [EntityNameHS] -> ShowS
    EntityNameHS -> String
    (Int -> EntityNameHS -> ShowS)
    -> (EntityNameHS -> String)
    -> ([EntityNameHS] -> ShowS)
    -> Show EntityNameHS
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EntityNameHS -> ShowS
    showsPrec :: Int -> EntityNameHS -> ShowS
    $cshow :: EntityNameHS -> String
    show :: EntityNameHS -> String
    $cshowList :: [EntityNameHS] -> ShowS
    showList :: [EntityNameHS] -> ShowS
    Show, EntityNameHS -> EntityNameHS -> Bool
    (EntityNameHS -> EntityNameHS -> Bool)
    -> (EntityNameHS -> EntityNameHS -> Bool) -> Eq EntityNameHS
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EntityNameHS -> EntityNameHS -> Bool
    == :: EntityNameHS -> EntityNameHS -> Bool
    $c/= :: EntityNameHS -> EntityNameHS -> Bool
    /= :: EntityNameHS -> EntityNameHS -> Bool
    Eq, ReadPrec [EntityNameHS]
    ReadPrec EntityNameHS
    Int -> ReadS EntityNameHS
    ReadS [EntityNameHS]
    (Int -> ReadS EntityNameHS)
    -> ReadS [EntityNameHS]
    -> ReadPrec EntityNameHS
    -> ReadPrec [EntityNameHS]
    -> Read EntityNameHS
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS EntityNameHS
    readsPrec :: Int -> ReadS EntityNameHS
    $creadList :: ReadS [EntityNameHS]
    readList :: ReadS [EntityNameHS]
    $creadPrec :: ReadPrec EntityNameHS
    readPrec :: ReadPrec EntityNameHS
    $creadListPrec :: ReadPrec [EntityNameHS]
    readListPrec :: ReadPrec [EntityNameHS]
    Read, Eq EntityNameHS
    Eq EntityNameHS =>
    (EntityNameHS -> EntityNameHS -> Ordering)
    -> (EntityNameHS -> EntityNameHS -> Bool)
    -> (EntityNameHS -> EntityNameHS -> Bool)
    -> (EntityNameHS -> EntityNameHS -> Bool)
    -> (EntityNameHS -> EntityNameHS -> Bool)
    -> (EntityNameHS -> EntityNameHS -> EntityNameHS)
    -> (EntityNameHS -> EntityNameHS -> EntityNameHS)
    -> Ord EntityNameHS
    EntityNameHS -> EntityNameHS -> Bool
    EntityNameHS -> EntityNameHS -> Ordering
    EntityNameHS -> EntityNameHS -> EntityNameHS
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: EntityNameHS -> EntityNameHS -> Ordering
    compare :: EntityNameHS -> EntityNameHS -> Ordering
    $c< :: EntityNameHS -> EntityNameHS -> Bool
    < :: EntityNameHS -> EntityNameHS -> Bool
    $c<= :: EntityNameHS -> EntityNameHS -> Bool
    <= :: EntityNameHS -> EntityNameHS -> Bool
    $c> :: EntityNameHS -> EntityNameHS -> Bool
    > :: EntityNameHS -> EntityNameHS -> Bool
    $c>= :: EntityNameHS -> EntityNameHS -> Bool
    >= :: EntityNameHS -> EntityNameHS -> Bool
    $cmax :: EntityNameHS -> EntityNameHS -> EntityNameHS
    max :: EntityNameHS -> EntityNameHS -> EntityNameHS
    $cmin :: EntityNameHS -> EntityNameHS -> EntityNameHS
    min :: EntityNameHS -> EntityNameHS -> EntityNameHS
    Ord, (forall (m :: * -> *). Quote m => EntityNameHS -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        EntityNameHS -> Code m EntityNameHS)
    -> Lift EntityNameHS
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => EntityNameHS -> m Exp
    forall (m :: * -> *).
    Quote m =>
    EntityNameHS -> Code m EntityNameHS
    $clift :: forall (m :: * -> *). Quote m => EntityNameHS -> m Exp
    lift :: forall (m :: * -> *). Quote m => EntityNameHS -> m Exp
    $cliftTyped :: forall (m :: * -> *).
    Quote m =>
    EntityNameHS -> Code m EntityNameHS
    liftTyped :: forall (m :: * -> *).
    Quote m =>
    EntityNameHS -> Code m EntityNameHS
    Lift)

    -- | An 'EntityNameDB' represents the datastore-side name that @persistent@
    -- will use for an entity.
    --
    -- @since 2.12.0.0
    newtype EntityNameDB = EntityNameDB { EntityNameDB -> Text
    unEntityNameDB :: Text }
        deriving (Int -> EntityNameDB -> ShowS
    [EntityNameDB] -> ShowS
    EntityNameDB -> String
    (Int -> EntityNameDB -> ShowS)
    -> (EntityNameDB -> String)
    -> ([EntityNameDB] -> ShowS)
    -> Show EntityNameDB
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EntityNameDB -> ShowS
    showsPrec :: Int -> EntityNameDB -> ShowS
    $cshow :: EntityNameDB -> String
    show :: EntityNameDB -> String
    $cshowList :: [EntityNameDB] -> ShowS
    showList :: [EntityNameDB] -> ShowS
    Show, EntityNameDB -> EntityNameDB -> Bool
    (EntityNameDB -> EntityNameDB -> Bool)
    -> (EntityNameDB -> EntityNameDB -> Bool) -> Eq EntityNameDB
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EntityNameDB -> EntityNameDB -> Bool
    == :: EntityNameDB -> EntityNameDB -> Bool
    $c/= :: EntityNameDB -> EntityNameDB -> Bool
    /= :: EntityNameDB -> EntityNameDB -> Bool
    Eq, ReadPrec [EntityNameDB]
    ReadPrec EntityNameDB
    Int -> ReadS EntityNameDB
    ReadS [EntityNameDB]
    (Int -> ReadS EntityNameDB)
    -> ReadS [EntityNameDB]
    -> ReadPrec EntityNameDB
    -> ReadPrec [EntityNameDB]
    -> Read EntityNameDB
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS EntityNameDB
    readsPrec :: Int -> ReadS EntityNameDB
    $creadList :: ReadS [EntityNameDB]
    readList :: ReadS [EntityNameDB]
    $creadPrec :: ReadPrec EntityNameDB
    readPrec :: ReadPrec EntityNameDB
    $creadListPrec :: ReadPrec [EntityNameDB]
    readListPrec :: ReadPrec [EntityNameDB]
    Read, Eq EntityNameDB
    Eq EntityNameDB =>
    (EntityNameDB -> EntityNameDB -> Ordering)
    -> (EntityNameDB -> EntityNameDB -> Bool)
    -> (EntityNameDB -> EntityNameDB -> Bool)
    -> (EntityNameDB -> EntityNameDB -> Bool)
    -> (EntityNameDB -> EntityNameDB -> Bool)
    -> (EntityNameDB -> EntityNameDB -> EntityNameDB)
    -> (EntityNameDB -> EntityNameDB -> EntityNameDB)
    -> Ord EntityNameDB
    EntityNameDB -> EntityNameDB -> Bool
    EntityNameDB -> EntityNameDB -> Ordering
    EntityNameDB -> EntityNameDB -> EntityNameDB
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: EntityNameDB -> EntityNameDB -> Ordering
    compare :: EntityNameDB -> EntityNameDB -> Ordering
    $c< :: EntityNameDB -> EntityNameDB -> Bool
    < :: EntityNameDB -> EntityNameDB -> Bool
    $c<= :: EntityNameDB -> EntityNameDB -> Bool
    <= :: EntityNameDB -> EntityNameDB -> Bool
    $c> :: EntityNameDB -> EntityNameDB -> Bool
    > :: EntityNameDB -> EntityNameDB -> Bool
    $c>= :: EntityNameDB -> EntityNameDB -> Bool
    >= :: EntityNameDB -> EntityNameDB -> Bool
    $cmax :: EntityNameDB -> EntityNameDB -> EntityNameDB
    max :: EntityNameDB -> EntityNameDB -> EntityNameDB
    $cmin :: EntityNameDB -> EntityNameDB -> EntityNameDB
    min :: EntityNameDB -> EntityNameDB -> EntityNameDB
    Ord, (forall (m :: * -> *). Quote m => EntityNameDB -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        EntityNameDB -> Code m EntityNameDB)
    -> Lift EntityNameDB
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => EntityNameDB -> m Exp
    forall (m :: * -> *).
    Quote m =>
    EntityNameDB -> Code m EntityNameDB
    $clift :: forall (m :: * -> *). Quote m => EntityNameDB -> m Exp
    lift :: forall (m :: * -> *). Quote m => EntityNameDB -> m Exp
    $cliftTyped :: forall (m :: * -> *).
    Quote m =>
    EntityNameDB -> Code m EntityNameDB
    liftTyped :: forall (m :: * -> *).
    Quote m =>
    EntityNameDB -> Code m EntityNameDB
    Lift)

    instance DatabaseName EntityNameDB where
        escapeWith :: forall str. (Text -> str) -> EntityNameDB -> str
    escapeWith Text -> str
    f (EntityNameDB Text
    n) = Text -> str
    f Text
    n

    -- | A 'ConstraintNameDB' represents the datastore-side name that @persistent@
    -- will use for a constraint.
    --
    -- @since 2.12.0.0
    newtype ConstraintNameDB = ConstraintNameDB { ConstraintNameDB -> Text
    unConstraintNameDB :: Text }
      deriving (Int -> ConstraintNameDB -> ShowS
    [ConstraintNameDB] -> ShowS
    ConstraintNameDB -> String
    (Int -> ConstraintNameDB -> ShowS)
    -> (ConstraintNameDB -> String)
    -> ([ConstraintNameDB] -> ShowS)
    -> Show ConstraintNameDB
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ConstraintNameDB -> ShowS
    showsPrec :: Int -> ConstraintNameDB -> ShowS
    $cshow :: ConstraintNameDB -> String
    show :: ConstraintNameDB -> String
    $cshowList :: [ConstraintNameDB] -> ShowS
    showList :: [ConstraintNameDB] -> ShowS
    Show, ConstraintNameDB -> ConstraintNameDB -> Bool
    (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> Eq ConstraintNameDB
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ConstraintNameDB -> ConstraintNameDB -> Bool
    == :: ConstraintNameDB -> ConstraintNameDB -> Bool
    $c/= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    /= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    Eq, ReadPrec [ConstraintNameDB]
    ReadPrec ConstraintNameDB
    Int -> ReadS ConstraintNameDB
    ReadS [ConstraintNameDB]
    (Int -> ReadS ConstraintNameDB)
    -> ReadS [ConstraintNameDB]
    -> ReadPrec ConstraintNameDB
    -> ReadPrec [ConstraintNameDB]
    -> Read ConstraintNameDB
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS ConstraintNameDB
    readsPrec :: Int -> ReadS ConstraintNameDB
    $creadList :: ReadS [ConstraintNameDB]
    readList :: ReadS [ConstraintNameDB]
    $creadPrec :: ReadPrec ConstraintNameDB
    readPrec :: ReadPrec ConstraintNameDB
    $creadListPrec :: ReadPrec [ConstraintNameDB]
    readListPrec :: ReadPrec [ConstraintNameDB]
    Read, Eq ConstraintNameDB
    Eq ConstraintNameDB =>
    (ConstraintNameDB -> ConstraintNameDB -> Ordering)
    -> (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> (ConstraintNameDB -> ConstraintNameDB -> Bool)
    -> (ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB)
    -> (ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB)
    -> Ord ConstraintNameDB
    ConstraintNameDB -> ConstraintNameDB -> Bool
    ConstraintNameDB -> ConstraintNameDB -> Ordering
    ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: ConstraintNameDB -> ConstraintNameDB -> Ordering
    compare :: ConstraintNameDB -> ConstraintNameDB -> Ordering
    $c< :: ConstraintNameDB -> ConstraintNameDB -> Bool
    < :: ConstraintNameDB -> ConstraintNameDB -> Bool
    $c<= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    <= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    $c> :: ConstraintNameDB -> ConstraintNameDB -> Bool
    > :: ConstraintNameDB -> ConstraintNameDB -> Bool
    $c>= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    >= :: ConstraintNameDB -> ConstraintNameDB -> Bool
    $cmax :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB
    max :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB
    $cmin :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB
    min :: ConstraintNameDB -> ConstraintNameDB -> ConstraintNameDB
    Ord, (forall (m :: * -> *). Quote m => ConstraintNameDB -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        ConstraintNameDB -> Code m ConstraintNameDB)
    -> Lift ConstraintNameDB
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => ConstraintNameDB -> m Exp
    forall (m :: * -> *).
    Quote m =>
    ConstraintNameDB -> Code m ConstraintNameDB
    $clift :: forall (m :: * -> *). Quote m => ConstraintNameDB -> m Exp
    lift :: forall (m :: * -> *). Quote m => ConstraintNameDB -> m Exp
    $cliftTyped :: forall (m :: * -> *).
    Quote m =>
    ConstraintNameDB -> Code m ConstraintNameDB
    liftTyped :: forall (m :: * -> *).
    Quote m =>
    ConstraintNameDB -> Code m ConstraintNameDB
    Lift)

    -- | @since 2.12.0.0
    instance DatabaseName ConstraintNameDB where
      escapeWith :: forall str. (Text -> str) -> ConstraintNameDB -> str
    escapeWith Text -> str
    f (ConstraintNameDB Text
    n) = Text -> str
    f Text
    n

    -- | An 'ConstraintNameHS' represents the Haskell-side name that @persistent@
    -- will use for a constraint.
    --
    -- @since 2.12.0.0
    newtype ConstraintNameHS = ConstraintNameHS { ConstraintNameHS -> Text
    unConstraintNameHS :: Text }
      deriving (Int -> ConstraintNameHS -> ShowS
    [ConstraintNameHS] -> ShowS
    ConstraintNameHS -> String
    (Int -> ConstraintNameHS -> ShowS)
    -> (ConstraintNameHS -> String)
    -> ([ConstraintNameHS] -> ShowS)
    -> Show ConstraintNameHS
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ConstraintNameHS -> ShowS
    showsPrec :: Int -> ConstraintNameHS -> ShowS
    $cshow :: ConstraintNameHS -> String
    show :: ConstraintNameHS -> String
    $cshowList :: [ConstraintNameHS] -> ShowS
    showList :: [ConstraintNameHS] -> ShowS
    Show, ConstraintNameHS -> ConstraintNameHS -> Bool
    (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> Eq ConstraintNameHS
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ConstraintNameHS -> ConstraintNameHS -> Bool
    == :: ConstraintNameHS -> ConstraintNameHS -> Bool
    $c/= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    /= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    Eq, ReadPrec [ConstraintNameHS]
    ReadPrec ConstraintNameHS
    Int -> ReadS ConstraintNameHS
    ReadS [ConstraintNameHS]
    (Int -> ReadS ConstraintNameHS)
    -> ReadS [ConstraintNameHS]
    -> ReadPrec ConstraintNameHS
    -> ReadPrec [ConstraintNameHS]
    -> Read ConstraintNameHS
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS ConstraintNameHS
    readsPrec :: Int -> ReadS ConstraintNameHS
    $creadList :: ReadS [ConstraintNameHS]
    readList :: ReadS [ConstraintNameHS]
    $creadPrec :: ReadPrec ConstraintNameHS
    readPrec :: ReadPrec ConstraintNameHS
    $creadListPrec :: ReadPrec [ConstraintNameHS]
    readListPrec :: ReadPrec [ConstraintNameHS]
    Read, Eq ConstraintNameHS
    Eq ConstraintNameHS =>
    (ConstraintNameHS -> ConstraintNameHS -> Ordering)
    -> (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> (ConstraintNameHS -> ConstraintNameHS -> Bool)
    -> (ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS)
    -> (ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS)
    -> Ord ConstraintNameHS
    ConstraintNameHS -> ConstraintNameHS -> Bool
    ConstraintNameHS -> ConstraintNameHS -> Ordering
    ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: ConstraintNameHS -> ConstraintNameHS -> Ordering
    compare :: ConstraintNameHS -> ConstraintNameHS -> Ordering
    $c< :: ConstraintNameHS -> ConstraintNameHS -> Bool
    < :: ConstraintNameHS -> ConstraintNameHS -> Bool
    $c<= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    <= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    $c> :: ConstraintNameHS -> ConstraintNameHS -> Bool
    > :: ConstraintNameHS -> ConstraintNameHS -> Bool
    $c>= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    >= :: ConstraintNameHS -> ConstraintNameHS -> Bool
    $cmax :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS
    max :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS
    $cmin :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS
    min :: ConstraintNameHS -> ConstraintNameHS -> ConstraintNameHS
    Ord, (forall (m :: * -> *). Quote m => ConstraintNameHS -> m Exp)
    -> (forall (m :: * -> *).
        Quote m =>
        ConstraintNameHS -> Code m ConstraintNameHS)
    -> Lift ConstraintNameHS
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => ConstraintNameHS -> m Exp
    forall (m :: * -> *).
    Quote m =>
    ConstraintNameHS -> Code m ConstraintNameHS
    $clift :: forall (m :: * -> *). Quote m => ConstraintNameHS -> m Exp
    lift :: forall (m :: * -> *). Quote m => ConstraintNameHS -> m Exp
    $cliftTyped :: forall (m :: * -> *).
    Quote m =>
    ConstraintNameHS -> Code m ConstraintNameHS
    liftTyped :: forall (m :: * -> *).
    Quote m =>
    ConstraintNameHS -> Code m ConstraintNameHS
    Lift)