| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Hydra.Ext.RelationalModel
Description
An interpretation of Codd's Relational Model, as described in 'A Relational Model of Data for Large Shared Data Banks' (1970). Types (domains) and values are parameterized so as to allow for application-specific implementations. No special support is provided for nonsimple domains; i.e. relations are assumed to be normalized.
Synopsis
- newtype ColumnName = ColumnName {}
- _ColumnName :: Name
- data ColumnSchema t = ColumnSchema {}
- _ColumnSchema :: Name
- _ColumnSchema_name :: Name
- _ColumnSchema_domain :: Name
- _ColumnSchema_isPrimaryKey :: Name
- data ForeignKey = ForeignKey {}
- _ForeignKey :: Name
- _ForeignKey_foreignRelation :: Name
- _ForeignKey_keys :: Name
- newtype PrimaryKey = PrimaryKey {
- unPrimaryKey :: [ColumnName]
- _PrimaryKey :: Name
- newtype Relation v = Relation {
- unRelation :: Set [v]
- _Relation :: Name
- newtype RelationName = RelationName {}
- _RelationName :: Name
- data RelationSchema t = RelationSchema {}
- _RelationSchema :: Name
- _RelationSchema_name :: Name
- _RelationSchema_columns :: Name
- _RelationSchema_primaryKeys :: Name
- _RelationSchema_foreignKeys :: Name
- newtype Relationship v = Relationship {
- unRelationship :: Set (Map ColumnName v)
- _Relationship :: Name
- newtype Row v = Row {
- unRow :: [v]
- _Row :: Name
Documentation
newtype ColumnName Source #
A name for a domain which serves to identify the role played by that domain in the given relation; a 'role name' in Codd
Constructors
| ColumnName | |
Fields | |
Instances
| Read ColumnName Source # | |
Defined in Hydra.Ext.RelationalModel Methods readsPrec :: Int -> ReadS ColumnName # readList :: ReadS [ColumnName] # readPrec :: ReadPrec ColumnName # readListPrec :: ReadPrec [ColumnName] # | |
| Show ColumnName Source # | |
Defined in Hydra.Ext.RelationalModel Methods showsPrec :: Int -> ColumnName -> ShowS # show :: ColumnName -> String # showList :: [ColumnName] -> ShowS # | |
| Eq ColumnName Source # | |
Defined in Hydra.Ext.RelationalModel | |
| Ord ColumnName Source # | |
Defined in Hydra.Ext.RelationalModel Methods compare :: ColumnName -> ColumnName -> Ordering # (<) :: ColumnName -> ColumnName -> Bool # (<=) :: ColumnName -> ColumnName -> Bool # (>) :: ColumnName -> ColumnName -> Bool # (>=) :: ColumnName -> ColumnName -> Bool # max :: ColumnName -> ColumnName -> ColumnName # min :: ColumnName -> ColumnName -> ColumnName # | |
_ColumnName :: Name Source #
data ColumnSchema t Source #
An abstract specification of the domain represented by a column in a relation; a role
Constructors
| ColumnSchema | |
Fields
| |
Instances
_ColumnSchema :: Name Source #
data ForeignKey Source #
A mapping from certain columns of a source relation to primary key columns of a target relation
Constructors
| ForeignKey | |
Fields
| |
Instances
| Read ForeignKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods readsPrec :: Int -> ReadS ForeignKey # readList :: ReadS [ForeignKey] # readPrec :: ReadPrec ForeignKey # readListPrec :: ReadPrec [ForeignKey] # | |
| Show ForeignKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods showsPrec :: Int -> ForeignKey -> ShowS # show :: ForeignKey -> String # showList :: [ForeignKey] -> ShowS # | |
| Eq ForeignKey Source # | |
Defined in Hydra.Ext.RelationalModel | |
| Ord ForeignKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods compare :: ForeignKey -> ForeignKey -> Ordering # (<) :: ForeignKey -> ForeignKey -> Bool # (<=) :: ForeignKey -> ForeignKey -> Bool # (>) :: ForeignKey -> ForeignKey -> Bool # (>=) :: ForeignKey -> ForeignKey -> Bool # max :: ForeignKey -> ForeignKey -> ForeignKey # min :: ForeignKey -> ForeignKey -> ForeignKey # | |
_ForeignKey :: Name Source #
newtype PrimaryKey Source #
A primary key of a relation, specified either as a single column, or as a list of columns
Constructors
| PrimaryKey | |
Fields
| |
Instances
| Read PrimaryKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods readsPrec :: Int -> ReadS PrimaryKey # readList :: ReadS [PrimaryKey] # readPrec :: ReadPrec PrimaryKey # readListPrec :: ReadPrec [PrimaryKey] # | |
| Show PrimaryKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods showsPrec :: Int -> PrimaryKey -> ShowS # show :: PrimaryKey -> String # showList :: [PrimaryKey] -> ShowS # | |
| Eq PrimaryKey Source # | |
Defined in Hydra.Ext.RelationalModel | |
| Ord PrimaryKey Source # | |
Defined in Hydra.Ext.RelationalModel Methods compare :: PrimaryKey -> PrimaryKey -> Ordering # (<) :: PrimaryKey -> PrimaryKey -> Bool # (<=) :: PrimaryKey -> PrimaryKey -> Bool # (>) :: PrimaryKey -> PrimaryKey -> Bool # (>=) :: PrimaryKey -> PrimaryKey -> Bool # max :: PrimaryKey -> PrimaryKey -> PrimaryKey # min :: PrimaryKey -> PrimaryKey -> PrimaryKey # | |
_PrimaryKey :: Name Source #
A set of distinct n-tuples; a table
Constructors
| Relation | |
Fields
| |
Instances
| (Read v, Ord v) => Read (Relation v) Source # | |
| Show v => Show (Relation v) Source # | |
| Eq v => Eq (Relation v) Source # | |
| Ord v => Ord (Relation v) Source # | |
Defined in Hydra.Ext.RelationalModel | |
newtype RelationName Source #
A unique relation (table) name
Constructors
| RelationName | |
Fields | |
Instances
| Read RelationName Source # | |
Defined in Hydra.Ext.RelationalModel Methods readsPrec :: Int -> ReadS RelationName # readList :: ReadS [RelationName] # | |
| Show RelationName Source # | |
Defined in Hydra.Ext.RelationalModel Methods showsPrec :: Int -> RelationName -> ShowS # show :: RelationName -> String # showList :: [RelationName] -> ShowS # | |
| Eq RelationName Source # | |
Defined in Hydra.Ext.RelationalModel | |
| Ord RelationName Source # | |
Defined in Hydra.Ext.RelationalModel Methods compare :: RelationName -> RelationName -> Ordering # (<) :: RelationName -> RelationName -> Bool # (<=) :: RelationName -> RelationName -> Bool # (>) :: RelationName -> RelationName -> Bool # (>=) :: RelationName -> RelationName -> Bool # max :: RelationName -> RelationName -> RelationName # min :: RelationName -> RelationName -> RelationName # | |
_RelationName :: Name Source #
data RelationSchema t Source #
An abstract relation; the name and columns of a relation without its actual data
Constructors
| RelationSchema | |
Fields
| |
Instances
newtype Relationship v Source #
A domain-unordered (string-indexed, rather than position-indexed) relation
Constructors
| Relationship | |
Fields
| |
Instances
_Relationship :: Name Source #