postgrest-9.0.0: REST API for any Postgres database
Safe HaskellNone
LanguageHaskell2010

PostgREST.DbStructure.Relationship

Synopsis

Documentation

data Cardinality Source #

The relationship cardinality | https://en.wikipedia.org/wiki/Cardinality_(data_modeling) TODO: missing one-to-one

Constructors

O2M FKConstraint

one-to-many cardinality

M2O FKConstraint

many-to-one cardinality

M2M Junction

many-to-many cardinality

data PrimaryKey Source #

Constructors

PrimaryKey 

Fields

Instances

Instances details
Generic PrimaryKey Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

Associated Types

type Rep PrimaryKey :: Type -> Type #

ToJSON PrimaryKey Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

type Rep PrimaryKey Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

type Rep PrimaryKey = D1 ('MetaData "PrimaryKey" "PostgREST.DbStructure.Relationship" "postgrest-9.0.0-inplace" '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

Instances

Instances details
Eq Relationship Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

Generic Relationship Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

Associated Types

type Rep Relationship :: Type -> Type #

ToJSON Relationship Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

type Rep Relationship Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

type Rep Relationship = D1 ('MetaData "Relationship" "PostgREST.DbStructure.Relationship" "postgrest-9.0.0-inplace" 'False) (C1 ('MetaCons "Relationship" 'PrefixI 'True) ((S1 ('MetaSel ('Just "relTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Table) :*: S1 ('MetaSel ('Just "relColumns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Column])) :*: (S1 ('MetaSel ('Just "relForeignTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Table) :*: (S1 ('MetaSel ('Just "relForeignColumns") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Column]) :*: S1 ('MetaSel ('Just "relCardinality") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Cardinality)))))

data Junction Source #

Junction table on an M2M relationship

Constructors

Junction 

Fields

Instances

Instances details
Eq Junction Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

Generic Junction Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

Associated Types

type Rep Junction :: Type -> Type #

Methods

from :: Junction -> Rep Junction x #

to :: Rep Junction x -> Junction #

ToJSON Junction Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship

type Rep Junction Source # 
Instance details

Defined in PostgREST.DbStructure.Relationship