This module contains some useful operations on the data types representing entity/relationship diagrams
Author: Michael Hanus
Version: January 2018
erdName
:: ERD -> String
The name of an ERD. |
entityName
:: Entity -> String
The name of an entity. |
isEntityNamed
:: String -> Entity -> Bool
Is this an entity with a given name? |
hasForeignKey
:: String -> Entity -> Bool
Has the entity an attribute with a foreign key for a given entity name? |
foreignKeyAttributes
:: String -> [Attribute] -> [Attribute]
Returns the attributes that are a foreign key of a given entity name. |
entityAttributes
:: Entity -> [Attribute]
The attributes of an entity |
attributeName
:: Attribute -> String
The name of an attribute. |
attributeDomain
:: Attribute -> Domain
The domain of an attribute. |
hasDefault
:: Domain -> Bool
Has an attribute domain a default value? |
isForeignKey
:: Attribute -> Bool
|
isNullAttribute
:: Attribute -> Bool
Has an attribute a null value? |
cardMinimum
:: Cardinality -> Int
The minimum value of a cardinality. |
cardMaximum
:: Cardinality -> Int
The maximum value of a cardinality (provided that it is not infinite). |
showERD
:: Int -> ERD -> String
A simple pretty printer for ERDs. |
combineIds
:: [String] -> String
Combines a non-empty list of identifiers into a single identifier. |
storeERDFromProgram
:: String -> IO String
Writes the ERD defined in a Curry program (as a top-level operation of type Database.ERD.ERD ) in a term file and return the name of
the term file.
|
The name of an ERD.
|
The name of an entity.
|
Is this an entity with a given name? |
Has the entity an attribute with a foreign key for a given entity name? |
Returns the attributes that are a foreign key of a given entity name. |
The attributes of an entity
|
The name of an attribute.
|
The domain of an attribute.
|
Has an attribute domain a default value?
|
|
Has an attribute a null value?
|
The minimum value of a cardinality.
|
The maximum value of a cardinality (provided that it is not infinite).
|
Combines a non-empty list of identifiers into a single identifier. Used in ERD transformation and code generation to create names for combined objects, e.g., relationships and foreign keys.
|
Writes the ERD defined in a Curry program (as a top-level operation
of type |