Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ForeignKey = ForeignKey {
- fkColumns :: [RawSQL ()]
- fkRefTable :: RawSQL ()
- fkRefColumns :: [RawSQL ()]
- fkOnUpdate :: ForeignKeyAction
- fkOnDelete :: ForeignKeyAction
- fkDeferrable :: Bool
- fkDeferred :: Bool
- fkValidated :: Bool
- data ForeignKeyAction
- fkOnColumn :: RawSQL () -> RawSQL () -> RawSQL () -> ForeignKey
- fkOnColumns :: [RawSQL ()] -> RawSQL () -> [RawSQL ()] -> ForeignKey
- fkName :: RawSQL () -> ForeignKey -> RawSQL ()
- sqlAddValidFKMaybeDowntime :: RawSQL () -> ForeignKey -> RawSQL ()
- sqlAddNotValidFK :: RawSQL () -> ForeignKey -> RawSQL ()
- sqlValidateFK :: RawSQL () -> ForeignKey -> RawSQL ()
- sqlDropFK :: RawSQL () -> ForeignKey -> RawSQL ()
Documentation
data ForeignKey Source #
ForeignKey | |
|
Instances
Show ForeignKey Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey showsPrec :: Int -> ForeignKey -> ShowS # show :: ForeignKey -> String # showList :: [ForeignKey] -> ShowS # | |
Eq ForeignKey Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey (==) :: ForeignKey -> ForeignKey -> Bool # (/=) :: ForeignKey -> ForeignKey -> Bool # | |
Ord ForeignKey Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey compare :: ForeignKey -> ForeignKey -> Ordering # (<) :: ForeignKey -> ForeignKey -> Bool # (<=) :: ForeignKey -> ForeignKey -> Bool # (>) :: ForeignKey -> ForeignKey -> Bool # (>=) :: ForeignKey -> ForeignKey -> Bool # max :: ForeignKey -> ForeignKey -> ForeignKey # min :: ForeignKey -> ForeignKey -> ForeignKey # |
data ForeignKeyAction Source #
Instances
Show ForeignKeyAction Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey showsPrec :: Int -> ForeignKeyAction -> ShowS # show :: ForeignKeyAction -> String # showList :: [ForeignKeyAction] -> ShowS # | |
Eq ForeignKeyAction Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey (==) :: ForeignKeyAction -> ForeignKeyAction -> Bool # (/=) :: ForeignKeyAction -> ForeignKeyAction -> Bool # | |
Ord ForeignKeyAction Source # | |
Defined in Database.PostgreSQL.PQTypes.Model.ForeignKey compare :: ForeignKeyAction -> ForeignKeyAction -> Ordering # (<) :: ForeignKeyAction -> ForeignKeyAction -> Bool # (<=) :: ForeignKeyAction -> ForeignKeyAction -> Bool # (>) :: ForeignKeyAction -> ForeignKeyAction -> Bool # (>=) :: ForeignKeyAction -> ForeignKeyAction -> Bool # max :: ForeignKeyAction -> ForeignKeyAction -> ForeignKeyAction # min :: ForeignKeyAction -> ForeignKeyAction -> ForeignKeyAction # |
fkOnColumn :: RawSQL () -> RawSQL () -> RawSQL () -> ForeignKey Source #
fkOnColumns :: [RawSQL ()] -> RawSQL () -> [RawSQL ()] -> ForeignKey Source #
sqlAddValidFKMaybeDowntime :: RawSQL () -> ForeignKey -> RawSQL () Source #
Add valid foreign key. Warning: PostgreSQL acquires SHARE ROW EXCLUSIVE
lock (that prevents data updates) on both modified and referenced table for
the duration of the creation. If this is not acceptable, use
sqlAddNotValidFK
and sqlValidateFK
.
sqlAddNotValidFK :: RawSQL () -> ForeignKey -> RawSQL () Source #
Add foreign key marked as NOT VALID. This avoids potentially long
validation blocking updates to both modified and referenced table for its
duration. However, keys created as such need to be validated later using
sqlValidateFK
.
sqlValidateFK :: RawSQL () -> ForeignKey -> RawSQL () Source #
Validate foreign key previously created as NOT VALID.