Module SQLParserInfoType

This module defines the structure of the parser information used to pass information of the data model from an ERD-term to the SQL-Translator which is part of currypp. It consists of a tuple of the path to the corresponding database as string, and the name of the corresponding CDBI-module as String, a list or tupels mapping relationships to their types, a list of tupels representing column names and a nullable flag, a list of tupels of table name and list of corresponding column names, a list of tupels representing column name and its type as string. Furthermore a getter function for each part of the information is defined returning it as FM instead of a list. A lookup function for relationships is provided either.

Summary of exported operations:

dbName :: ParserInfo -> String  Deterministic 
Getter for path to used database.
cdbiModule :: ParserInfo -> String  Deterministic 
Getter for CDBI-module-name
getRelations :: ParserInfo -> Map String (Map String [(String,RelationType)])  Deterministic 
Getter for relationships represented as nested FM for faster access.
getNullables :: ParserInfo -> Map String Bool  Deterministic 
Getter for nullable-flag returned as a FM
getAttrList :: ParserInfo -> Map String (String,[String])  Deterministic 
Getter for for lists of attributes (columns) returned as FM.
getTypes :: ParserInfo -> Map String String  Deterministic 
Getter for column types returnd as FM.
lookupRel :: (String,String,String) -> Map String (Map String [(String,RelationType)]) -> Maybe (RelationType,String)  Deterministic 
Lookup function for RelationFM.

Exported datatypes:


RelationFM

Type synonyms for all parts of the parser information

Type synonym: RelationFM = Map String (Map String [(String,RelationType)])


NullableFM

Type synonym: NullableFM = Map String Bool


AttributesFM

Type synonym: AttributesFM = Map String (String,[String])


AttrTypeFM

Type synonym: AttrTypeFM = Map String String


ParserInfo

Basic data type for parser information.

Constructors:


RelationType

Data type representing possible relationships in the relational model.

Constructors:

  • MtoN :: String -> RelationType
  • NtoOne :: String -> RelationType
  • OnetoN :: String -> RelationType

Exported operations:

dbName :: ParserInfo -> String  Deterministic 

Getter for path to used database.

Further infos:
  • solution complete, i.e., able to compute all solutions

cdbiModule :: ParserInfo -> String  Deterministic 

Getter for CDBI-module-name

Further infos:
  • solution complete, i.e., able to compute all solutions

getRelations :: ParserInfo -> Map String (Map String [(String,RelationType)])  Deterministic 

Getter for relationships represented as nested FM for faster access.

getNullables :: ParserInfo -> Map String Bool  Deterministic 

Getter for nullable-flag returned as a FM

getAttrList :: ParserInfo -> Map String (String,[String])  Deterministic 

Getter for for lists of attributes (columns) returned as FM.

getTypes :: ParserInfo -> Map String String  Deterministic 

Getter for column types returnd as FM.

lookupRel :: (String,String,String) -> Map String (Map String [(String,RelationType)]) -> Maybe (RelationType,String)  Deterministic 

Lookup function for RelationFM. In case of success return tuple of relation type and original notation.