README 2.32 KB
Newer Older
1
ER Tools for Curry
2
3
==================

4
5
6
7
8
9
10
11
12
13
This directory contains tools for dealing with database applications
specified by entity-relationship diagrams (ERDs) in Curry programs.

----------------------------------------------------------------------

ERD2CDBI compiler
-----------------

This tool transforms an ERD term into datatypes used in the
Database.CDBI. libraries. It also creates an information file
14
15
16
for the currypp SQL-Parser. This compiler is invoked by

    erd2curry --db <sqlite3 db file> --cdbi <Curry program with ERD>
17
18
19
20
21
22
23

----------------------------------------------------------------------

ERD2Curry compiler
------------------

This is a compiler for database applications
24
25
26
27
28
29
30
31
32
specified by entity-relationship diagrams (ERDs) into Curry programs.
The basic ideas and details about this approach are described in

B. Brassel, M. Hanus, M. Mueller:
High-Level Database Programming in Curry
In Proc. of the Tenth International Symposium on
Practical Aspects of Declarative Languages (PADL 2008),  pp. 316-332,
Springer LNCS 4902, 2008

33
34
Usage information:
------------------
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

Default use without Umbrello UML Modeller but ERD term descriptions:

1. Go to the directory where you want to create your Curry program and
   create an ERD description as a Curry term of type ERD
   (w.r.t. type definition given in module ERD.curry), e.g.,
   stored in "mymodel.erdterm".

2. Compile it into a Curry program with

       erd2curry mymodel.erdterm

   This generates two auxiliary files `ERDGeneric.curry` and
   `KeyDatabase.curry` and a main file `<Model name>.curry>`
   containing the Curry API operations to the database.


Use with Umbrello UML Modeller (no longer actively supported):

1. Create an XML description of the ERD (with Umbrello)
   in xmi format, e.g., stored in "mymodel.xmi".

2. Compile it into a Curry program with

   erd2curry -x myerd.xmi


Visualization:
--------------

To visualize an ERD term file as a graph with dotty, execute

erd2curry -v mymodel.erdterm


Examples:
---------

73
74
The directory `examples` contains two examples for the specification
of ERD models:
75

76
* `BlogERD.curry`: a simple ERD model for a blog with entries, comments,
77
  and tags.
78
* `UniERD.curry`: an ERD model for university lectures as
79
80
81
82
83
  presented in the original paper cited above.

---
Further infos and contact:
Michael Hanus <http://www.informatik.uni-kiel.de/~mh>