Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Cardinality
- data PrimaryKey = PrimaryKey {}
- data Relationship = Relationship {}
- data Junction = Junction {
- junTable :: Table
- junConstraint1 :: FKConstraint
- junColumns1 :: [Column]
- junConstraint2 :: FKConstraint
- junColumns2 :: [Column]
- isSelfReference :: Relationship -> Bool
Documentation
data Cardinality Source #
The relationship cardinality | https://en.wikipedia.org/wiki/Cardinality_(data_modeling) TODO: missing one-to-one
O2M FKConstraint | one-to-many cardinality |
M2O FKConstraint | many-to-one cardinality |
M2M Junction | many-to-many cardinality |
Instances
Eq Cardinality Source # | |
Defined in PostgREST.DbStructure.Relationship (==) :: Cardinality -> Cardinality -> Bool # (/=) :: Cardinality -> Cardinality -> Bool # | |
Generic Cardinality Source # | |
Defined in PostgREST.DbStructure.Relationship type Rep Cardinality :: Type -> Type # from :: Cardinality -> Rep Cardinality x # to :: Rep Cardinality x -> Cardinality # | |
ToJSON Cardinality Source # | |
Defined in PostgREST.DbStructure.Relationship toJSON :: Cardinality -> Value # toEncoding :: Cardinality -> Encoding # toJSONList :: [Cardinality] -> Value # toEncodingList :: [Cardinality] -> Encoding # | |
type Rep Cardinality Source # | |
Defined in PostgREST.DbStructure.Relationship |
data PrimaryKey Source #
Instances
Generic PrimaryKey Source # | |
Defined in PostgREST.DbStructure.Relationship type Rep PrimaryKey :: Type -> Type # from :: PrimaryKey -> Rep PrimaryKey x # to :: Rep PrimaryKey x -> PrimaryKey # | |
ToJSON PrimaryKey Source # | |
Defined in PostgREST.DbStructure.Relationship toJSON :: PrimaryKey -> Value # toEncoding :: PrimaryKey -> Encoding # toJSONList :: [PrimaryKey] -> Value # toEncodingList :: [PrimaryKey] -> Encoding # | |
type Rep PrimaryKey Source # | |
Defined in PostgREST.DbStructure.Relationship type Rep PrimaryKey = D1 ('MetaData "PrimaryKey" "PostgREST.DbStructure.Relationship" "postgrest-8.0.0-4wwkfqOKlk5GjHJ3yFP36o" 'False) (C1 ('MetaCons "PrimaryKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "pkTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Table) :*: S1 ('MetaSel ('Just "pkName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
data Relationship Source #
Relationship between two tables.
The order of the relColumns and relForeignColumns should be maintained to get the join conditions right.
TODO merge relColumns and relForeignColumns to a tuple or Data.Bimap
Relationship | |
|
Instances
Junction table on an M2M relationship
Junction | |
|
isSelfReference :: Relationship -> Bool Source #