hpqtypes-extras-1.9.0.1: Extra utilities for hpqtypes library

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Model.ForeignKey

Synopsis

Documentation

fkOnColumns :: [RawSQL ()] -> RawSQL () -> [RawSQL ()] -> ForeignKey Source #

sqlAddFK :: RawSQL () -> ForeignKey -> RawSQL () Source #

Deprecated: Use sqlAddValidFK instead

Deprecated version of sqlAddValidFK.

sqlAddValidFK :: 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.