/
sample.dbm
157 lines (144 loc) · 4.75 KB
/
sample.dbm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="UTF-8"?>
<!--
ATENÇÃO: Não modifique este arquivo a não ser que você saiba
o que está fazendo. Resultados inesperados podem acontecer
caso o código seja alterado deliberadamente.
CAUTION: Do not modify this file unless you know what you are doing.
Unexpected results may occur if the code is changed deliberately.
-->
<dbmodel author="Raphael Araújo e Silva">
<database name="exampledb" encoding="UTF8">
<comment>Example Database Model</comment>
</database>
<language name="testlang" protected="true"/>
<function name="trigger_func"
window-func="false"
returns-setof="false"
behavior-type="CALLED ON NULL INPUT"
function-type="IMMUTABLE"
security-type="SECURITY DEFINER"
execution-cost="20"
row-amount="2500">
<schema name="public"/>
<language name="testlang"/>
<return-type>
<type name="trigger"/>
</return-type>
<parameter name="param1" in="true">
<type name="integer"/>
</parameter>
<definition>SELECT 1+1;</definition>
</function>
<table name="table" oids="false">
<schema name="public"/>
<position x="20" y="20"/>
<column name="column" not-null="true">
<type name="serial"/>
</column>
<column name="column1">
<type name="text"/>
</column>
<column name="column2" not-null="true">
<type name="integer"/>
</column>
<column name="column3">
<type name="text"/>
</column>
<constraint name="table_pk" type="pk-constr" factor="10" table="public.table">
<columns names="column" ref-type="src-columns"/>
</constraint>
<constraint name="table_uq" type="uq-constr" factor="10" table="public.table">
<columns names="column1" ref-type="src-columns"/>
</constraint>
<constraint name="table_ck" type="ck-constr" table="public.table">
<expression> column1 > 0 </expression>
</constraint>
<index name="index" table="public.table"
concurrent="true" unique="true" fast-update="false"
index-type="hash" factor="90">
<idxelement nulls-first="false" asc-order="false">
<column name="column1"/>
</idxelement>
</index>
</table>
<table name="table1" oids="false" protected="true">
<schema name="public"/>
<position x="422" y="24"/>
<column name="column" not-null="true" protected="true">
<type name="serial"/>
</column>
<column name="column1" protected="true">
<type name="text"/>
</column>
<column name="column2" not-null="true" protected="true">
<type name="integer"/>
</column>
<column name="column3" protected="true">
<type name="text"/>
</column>
<constraint name="table_pk" type="pk-constr" factor="10" protected="true" table="public.table1">
<columns names="column" ref-type="src-columns"/>
</constraint>
<constraint name="table_uq" type="uq-constr" factor="10" protected="true" table="public.table1">
<columns names="column1" ref-type="src-columns"/>
</constraint>
<constraint name="table_ck" type="ck-constr" protected="true" table="public.table1">
<expression> column1 > 0 </expression>
</constraint>
<rule name="rule1" event-type="ON INSERT"
exec-type="ALSO" protected="true">
<condition>column1 = 0</condition>
<commands>UPDATE public.table1 SET column1 = 1</commands>
</rule>
<trigger name="trigger1" firing-type="BEFORE" per-line="false"
ins-event="true" del-event="true" upd-event="true" trunc-event="false" protected="true">
<function signature="public.trigger_func(integer)"/>
</trigger>
</table>
<relationship name="relationship"
type="rel1n" protected="true"
src-required="false" dst-required="false"
table-name="relationship"
src-table="public.table1"
dst-table="public.table">
<column name="attribute">
<type name="integer"/>
</column>
<column name="attribute1">
<type name="integer"/>
</column>
<column name="attribute2">
<type name="integer"/>
</column>
</relationship>
<view name="view" protected="true">
<schema name="public"/>
<position x="320" y="250"/>
<reference table="public.table" column="column1" alias="t1" column-alias="col1"/>
<reference table="public.table1" column="column2" alias="t2" column-alias="col2"/>
<reference alias="expr">
<expression>extract(month from now())</expression>
</reference>
<reference table="public.table1" alias="t3" column-alias="col3"/>
<expression type="select-exp">0,1,2,3</expression>
<expression type="from-exp">3,0</expression>
</view>
<relationship name="rel_view_table"
type="reltv"
src-required="false" dst-required="false"
src-table="public.view"
dst-table="public.table"/>
<relationship name="rel_view_table1"
type="reltv"
src-required="false" dst-required="false"
src-table="public.view"
dst-table="public.table1"/>
<textbox name="textbox">
<position x="20" y="250"/>
<comment>Selected Textbox</comment>
</textbox>
<textbox name="textbox1" protected="true">
<position x="20" y="300"/>
<comment>Protected Textbox</comment>
</textbox>
</dbmodel>