|
definition: |
entity2createTable :: Entity -> String
entity2createTable (Entity name (a:atr)) = case a of
Attribute "Key" _ _ _ ->
"create table '" ++ name ++ "'(" ++
foldl (\y x -> y ++ " ," ++ attr2colType x) (attr2colType a) atr ++
");"
_ -> "create table '" ++ name ++ "'(" ++
foldl (\y x -> y ++ " ," ++ relationship2colType x)
(relationship2colType a)
atr ++
", primary key (" ++ attr2combPrimaryKey (a:atr) ++ "));"
|
|
demand: |
argument 1 |
|
deterministic: |
deterministic operation |
|
documentation: |
------------------------------------------------------------------------- Generates the `CREATE TABLE` SQL command for a given entity. |
|
failfree: |
<FAILING> |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{({Entity}) |-> _}
|
|
name: |
entity2createTable |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
Database.ERD.Entity -> String |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
yes |
|
totally-defined: |
possibly non-reducible on same data term |