erd-0.2.1.0: An entity-relationship diagram generator from a plain text description.

Safe HaskellNone
LanguageHaskell2010

Erd.ER

Synopsis

Documentation

data ER Source #

Represents a single schema.

Constructors

ER 

Fields

Instances
Eq ER Source # 
Instance details

Defined in Erd.ER

Methods

(==) :: ER -> ER -> Bool #

(/=) :: ER -> ER -> Bool #

Show ER Source # 
Instance details

Defined in Erd.ER

Methods

showsPrec :: Int -> ER -> ShowS #

show :: ER -> String #

showList :: [ER] -> ShowS #

data Entity Source #

Represents a single entity in a schema.

Constructors

Entity 
Instances
Eq Entity Source # 
Instance details

Defined in Erd.ER

Methods

(==) :: Entity -> Entity -> Bool #

(/=) :: Entity -> Entity -> Bool #

Ord Entity Source # 
Instance details

Defined in Erd.ER

Show Entity Source # 
Instance details

Defined in Erd.ER

data Attribute Source #

Represents a single attribute in a particular entity.

Constructors

Attribute 

Fields

Instances
Eq Attribute Source # 
Instance details

Defined in Erd.ER

Ord Attribute Source # 
Instance details

Defined in Erd.ER

Show Attribute Source # 
Instance details

Defined in Erd.ER

type Options = Map String Option Source #

Represents any number of options for an item in an ER diagram. An item may be the graph title, an entity, an entity header or a relationship between entities. Keys are options as specified in ER files.

Note that a set of options may include a label for any item.

mergeOpts :: Options -> Options -> Options Source #

Given two sets of options, merge the second into first, where elements in the first take precedence.

optionsTo :: (Option -> Maybe a) -> Options -> [a] Source #

Given a set of options and a selector function, return the list of only those options which matched. Examples of the selector function are optToFont, optToHtml and optToLabel.

data Option Source #

A restricted subset of options in GraphViz that can be configured in an ER file.

Instances
Eq Option Source # 
Instance details

Defined in Erd.ER

Methods

(==) :: Option -> Option -> Bool #

(/=) :: Option -> Option -> Bool #

Show Option Source # 
Instance details

Defined in Erd.ER

optionByName :: String -> String -> Either String Option Source #

Given an option name and a string representation of its value, optionByName will attempt to parse the string as a value corresponding to the option. If the option doesn't exist or there was a problem parsing the value, an error is returned.

optToFont :: Option -> Maybe Attribute Source #

Selects an option if and only if it corresponds to a font attribute.

optToHtml :: Option -> Maybe Attribute Source #

Selects an option if and only if it corresponds to an HTML attribute. In particular, for tables or table cells.

optToLabel :: Option -> Maybe Text Source #

Selects an option if and only if it corresponds to a label.

data Relation Source #

Represents a relationship between exactly two entities. After parsing, each rel is guaranteed to correspond to an entity defined in the same ER file.

Each relationship has one of four cardinalities specified for both entities. Those cardinalities are: 0 or 1, exactly 1, 0 or more and 1 or more.

Constructors

Relation 
Instances
Eq Relation Source # 
Instance details

Defined in Erd.ER

Show Relation Source # 
Instance details

Defined in Erd.ER

data Cardinality Source #

Constructors

ZeroOne 
One 
ZeroPlus 
OnePlus 
Instances
Eq Cardinality Source # 
Instance details

Defined in Erd.ER

Show Cardinality Source # 
Instance details

Defined in Erd.ER

cardByName :: Char -> Maybe Cardinality Source #

Maps a string representation to a particular relationship cardinality.

defaultTitleOpts :: Options Source #

Hard-coded default options for all graph titles.

defaultEntityOpts :: Options Source #

Hard-coded default options for all entities.

defaultHeaderOpts :: Options Source #

Hard-coded default options for all entity headers.

defaultRelOpts :: Options Source #

Hard-coded default options for all relationships.