view_table_manager.anubis
2.34 KB
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
/*
* Created by PyramIDE.
* User: Totoro
* Date: 16/11/2011
* Time: 23:53
*/
read tools/basis.anubis
transmit hayamiki_lib/view/types/hk_form.anubis
transmit hayamiki_lib/view/view_table_manager_types.anubis
public define Maybe(VTM_view)
_vtm_get_view
(
String _table_name,
List(VTM_view) list
) =
if list is
{
[] then println("_vtm_get_view "+_table_name+" not found"); failure,
[ h . t ] then
if h.table_name = _table_name then
success(h)
else
_vtm_get_view(_table_name, t)
}.
public define Maybe(VTM_view)
vtm_get_view
(
String table_name,
VTM_view_list vtm_vlist
) =
_vtm_get_view(table_name, vtm_vlist.list).
public define Maybe(VTM_edit)
_vtm_get_edit
(
String table_name,
List(VTM_edit) list
) =
if list is
{
[] then failure,
[ h . t ] then
if h is vtm_edit(tb_name, get_edit) then
if tb_name = table_name then
success(h)
else
_vtm_get_edit(table_name, t)
}.
public define Maybe(VTM_edit)
vtm_get_edit
(
String table_name,
VTM_edit_list vtm_vlist
) =
_vtm_get_edit(table_name, vtm_vlist.list).
public define Maybe(TM_writer)
_tm_get_writer
(
String table_name,
List(TM_writer) list
) =
if list is
{
[] then failure,
[ h . t ] then
if h is tm_writer(tb_name, get_writer_from_type, get_writer_from_fields) then
if tb_name = table_name then
success(h)
else
_tm_get_writer(table_name, t)
}.
public define Maybe(TM_writer)
tm_get_writer
(
String table_name,
TM_writer_list tm_wlist
) =
_tm_get_writer(table_name, tm_wlist.list).
public define Maybe((SQLite3DataBase db, List(Int) l_int) -> Maybe(One))
_tm_get_delete
(
String table_name,
List(TM_delete) list
) =
if list is
{
[] then failure,
[ h . t ] then
since h is tm_delete(tb_name, delete_func),
if tb_name = table_name then
success(delete_func)
else
_tm_get_delete(table_name, t)
}.
public define Maybe((SQLite3DataBase db, List(Int) l_int) -> Maybe(One))
tm_get_delete
(
String table_name,
TM_delete_list tm_dlist
) =
_tm_get_delete(table_name, tm_dlist.list).