From ac555606b821b42dda3018f3e64240790b038161 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 13 Feb 2016 12:06:45 +0100 Subject: [PATCH] use hayamiki_lib instead of deprecated db_model --- database/model/db_model.anubis | 811 ++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 10 insertions(+), 801 deletions(-) diff --git a/database/model/db_model.anubis b/database/model/db_model.anubis index dcb34e7..02f3064 100644 --- a/database/model/db_model.anubis +++ b/database/model/db_model.anubis @@ -18,56 +18,6 @@ description of the database. - *** (1) Formal description of the database. - - *** (1.1) 'HK_Model_Field' (data types of table columns). -public type HK_App_Name: - this, - app_name(String name), - none. - -public type DB_Datetime_Field_Attr: - none, //Nothing special, normal behaviour - auto_now, //Always update datetime at SQL update - auto_now_add. //Set current datetime when row is created and can't be edited anymore - -public type HK_Model_Field: - //anubis(String _T), // the datum of type _T is serialized and base64 encoded - p_key, - //binary, // contains a byte array - boolean_field, // true or false - date_field(DB_Datetime_Field_Attr), // date with the precision of the day - time_field(DB_Datetime_Field_Attr), // time with the precision of the second - datetime_field(DB_Datetime_Field_Attr), // datetime with the precision of the second - foreign_key(HK_App_Name app_name, String table_name), // foreign key to 'id' in another (or same) table and column_name for choice selector. - integer_field, // integer of arbitrary size - char_field(Int size), // text of maximal size 'size' (number of characters) - text_field. // text of variable size - -public define HK_Model_Field - foreign_key - ( - String table_name - )= - foreign_key(this, table_name). - - From the point of view of your Anubis program, these data will be of types: - - Name | Anubis type | Type within the database - ----------------+-------------------+-------------------------------------------------- - //anubis | T (serializable) | text (base64 encoded serialization) - p_key | DB_id | primary key (integer) - //binary | ByteArray | text (the byte array base64 encoded) - boolean_field | Bool | boolean - date_field | DB_date | text (date in ISO-8601 format: yyyy-mm-dd) - time_field | DB_time | text (date in ISO-8601 format: hh:mm:ss) - datetime_field | DB_datetime | text (date in ISO-8601 format: yyyy-mm-dd hh:mm:ss) - foreign_key | Int | integer - integer_field | Int | arbitrary size integer (numeric) - char_field | String | max size text - text_field | String | arbitrary size text - - *** (1.2) 'MaybeNull'. @@ -89,135 +39,26 @@ public type MaybeNull($T): Possible attributes of columns: (each column has a list of such attributes) -public type HK_Model_Attr: - unique, // by default, the values in a column are not required to be all different - indexed, // by default, a column is not indexed - default(String), // default value (used in case of creation of a NON NULL column - // in a table which already contains some rows) - not_null. -public type HK_Help_Text: - no_help_text, //no help text available - help_text_TAG(String), //TAG use with Anubis translation tool /locale/L3.anubis - help_text(String). //pure text to show -public define String -/* Return the Anubis source of the type component -*/ - to_Anubis_source - ( - HK_Help_Text help - )= - if help is - { - no_help_text then "no_help_text", - help_text_TAG(tag) then "help_text_TAG(\""+tag+"\")", - help_text(str) then "help_text(\""+str+"\")" - }. - -public type HK_Icon: - no_icon, - icon16(String name). - -public define String -/* Return the Anubis source of the type component -*/ - to_Anubis_source - ( - HK_Icon icon - )= - if icon is - { - no_icon then "no_icon", - icon16(icn_str) then "icon16(\""+icn_str+"\")" - }. - -public define String -/* Return the Anubis source of the type component -*/ - to_String - ( - HK_Icon icon - )= - if icon is - { - no_icon then "\"\"", - icon16(icn_str) then "\""+icn_str+"_icon\"" - }. + + Of course, 'NOT NULL' is not an alternative of 'HK_Model_Attr' because it is already coded into the database type itself (type 'HK_Model_Field' above). - *** (1.4) 'HK_Model_Column' (describing a column in a table). - - Description of a column: - -public type HK_Model_Column: - hk_column (String name, // name of ordinary column (i.e. all but 'id') - HK_Model_Field type, - List(HK_Model_Attr) attributes, - HK_Help_Text help - ). - -public define HK_Model_Column -/* Constructor helper for db_column without help attribute. - the real type constructor will be called with the attribute no_help_text -*/ - hk_column - ( - String name, - HK_Model_Field type, - List(HK_Model_Attr) attributes, - )= - hk_column(name, type, attributes, no_help_text). - -public define HK_Model_Column - hk_column - ( - String name, - HK_Model_Field type - )= - hk_column(name, type, [], no_help_text). - - *** (3.7) 'DB_Model_Table' (describing a table). - Description of a table: -public type HK_Model: - hk_model( List(HK_Model_Column) columns, // columns other than the primary key column (if any) - String show_string). + *** (3.7) 'DB_Model_Table' (describing a table). -public type HK_List_View: - list_view_all, - list_view(String view_name, List(String) columns). + Description of a table: -public type HK_Edit_View: - edit_view_all, - edit_view(String view_name, List(String) columns). - -public type HK_Display: - hk_display(List(HK_List_View) list_views, - //List(HK_Edit_View) edit_views - List(String)). -public type HK_Table: - hk_table ( String name, //name of the table - String short_name, //table name without app_name in prefix - HK_Model model, - HK_Display display). - -public define HK_Table - hk_table - ( - String name, //name of the table - HK_Model model, - HK_Display display - )= - hk_table(name, "", model, display). + @@ -226,49 +67,9 @@ public define HK_Table Description of a whole database: -public type HK_App: - hk_app( - String app_name, - HK_Icon icon, - HK_Help_Text help, - List(HK_Table) hk_tables - ). - - /* Default constructor for HK_App*/ -public define HK_App - hk_app - ( - String app_name, - HK_Help_Text help, - List(HK_Table) hk_tables - )= - hk_app(app_name, no_icon, help, hk_tables). - -public define HK_App - hk_app - ( - String app_name, - HK_Icon icon, - List(HK_Table) hk_tables - )= - hk_app(app_name, icon, no_help_text, hk_tables). - - -public define HK_App - hk_app - ( - String app_name, - List(HK_Table) hk_tables - )= - hk_app(app_name, no_icon, no_help_text, hk_tables). -public type HK_Database: - hk_database (String name, // name of the database - List(HK_App) apps //list of applications - ). // list of all tables in the database - //public define Maybe(String) convert_to_date (MaybeNull(ByteArray) b). //public define MaybeNull(String) convert_to_date_or_null (MaybeNull(ByteArray) b). @@ -343,42 +144,7 @@ define macro Maybe(String) } }. -public define Int - longest_table_name_size - ( - List(HK_App) apps, - Int current_size - )= - if apps is - { - [] then current_size, - [app . t_apps] then - since app is hk_app(_, _, _, tables), - with max_size = max(map((HK_Table table) |-> length(table.name), tables), current_size), - longest_table_name_size(t_apps, max_size) - }. - -define Int - _max - ( - List(HK_Model_Column) columns, - Int current_max - )= - if columns is - { - [] then current_max, - [h . t] then - since h is hk_column(name, _, _, _), - _max(t, max(current_max, length(name))) - } - . - -public define Int - max - ( - List(HK_Model_Column) columns - )= - _max(columns, 0). + *** [2] Verifications concerning the description of the database and queries. @@ -449,565 +215,8 @@ public define Int *** [3.1] Converting a database type into the corresponding Anubis type: -public define String - to_Anubis_type - ( - HK_Model_Field t - ) = - if t is - { - //anubis(_T) then "ByteArray", - p_key then "DB_id", - //binary then "ByteArray", - boolean_field then "Bool", - date_field(_) then "DB_date", - time_field(_) then "DB_time", - datetime_field(_) then "DB_datetime", - foreign_key(_,_) then "Int", - integer_field then "Int", - char_field(Int size) then "String", - text_field then "String" - }. - -define String - format_attributes - ( - List(HK_Model_Attr) attributes - )= - join(" ",map((HK_Model_Attr attr) |-> - if attr is - { - unique then "UNIQUE", - indexed then "INDEXED", // by default, a column is not indexed - default(str) then "DEFAULT "+str, // default value (used in case of creation of a NON NULL column - // in a table which already contains some rows) - not_null then "NOT NULL" - }, attributes)). - -public define String - to_SQL_CREATE - ( - HK_Model_Field t, - List(HK_Model_Attr) attributes, - ) = - if t is - { - //anubis(_T) then "ByteArray", - p_key then fill("INTEGER", 15) +" PRIMARY KEY", - boolean_field then fill("BOOL", 15) +format_attributes(attributes), - date_field(_) then fill("DATE", 15) +format_attributes(attributes), - time_field(_) then fill("TIME", 15) +format_attributes(attributes), - datetime_field(_) then fill("DATETIME", 15)+format_attributes(attributes), - foreign_key(app,fk) then fill("INTEGER", 15) +" NOT NULL REFERENCES "+fk+" (id)", - integer_field then fill("INTEGER", 15) +format_attributes(attributes), - char_field(Int size) then fill("VARCHAR("+size+")", 15) +format_attributes(attributes), - text_field then fill("TEXT", 15) +format_attributes(attributes), - }. - -public define String - to_Anubis_default - ( - HK_Model_Field t - ) = - if t is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then "none", - //binary then "constant_byte_array(0,0)", - boolean_field then "false", - date_field(_) then "db_date(\"\")", - time_field(_) then "db_time(\"\")", - datetime_field(_) then "db_datetime(\"\")", - foreign_key(_,_) then "(Int)0", - integer_field then "(Int)0", - char_field(Int size) then "\"\"", - text_field then "\"\"" - }. - -public define String - from_DB_cursor - ( - HK_Model_Field t, - String cursor, - Int index - ) = - with cursor_index = "("+cursor+")("+index+")", - if t is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then "db_id((Int)db_integer"+cursor_index+")", - //binary then "constant_byte_array(0,0)", - boolean_field then "db_bool"+cursor_index, - date_field(_) then "db_date(text"+cursor_index+")", - time_field(_) then "db_time(text"+cursor_index+")", - datetime_field(_) then "db_datetime(text"+cursor_index+")", - foreign_key(_,_) then "(Int)db_integer"+cursor_index, - integer_field then "(Int)db_integer"+cursor_index, - char_field(Int size) then "text"+cursor_index, - text_field then "text"+cursor_index - }. - -define List(String) -/** - */ - components - ( - List(HK_Model_Column) columns, - String cursor_name, - List(String) so_far, - Int idx - )= - if columns is - { - [] then reverse(so_far), - [h . t ] then - since h is hk_column(name, col_type, _, _), - with line = fill(from_DB_cursor(col_type, cursor_name, idx), 35)+ "/* "+name+" */", - components(t, cursor_name, [line . so_far], idx + 1 ) - }. - -public define String - generate_constructor_from_cursor - ( - String constructor_name, - String cursor_name, - List(HK_Model_Column) columns, - String indent - )= - indent+constructor_name+"(\n"+indent+" "+join(",\n"+indent+" ", components(columns, cursor_name, [], 0))+"\n"+indent+")". - - -public define String - from_web_arg - ( - HK_Model_Field t, - String name - ) = - if t is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then "with "+name+" = get_DB_id(lwa, \""+name+"\"),", - //binary then "constant_byte_array(0,0)", - boolean_field then "with "+name+" = get_Bool(lwa, \""+name+"\"),", - date_field(attrs) then if attrs = none then "get_DB_date(lwa, \""+name+"\")" else "with "+name+" = get_dummy_DB_date,", - time_field(attrs) then if attrs = none then "get_DB_time(lwa, \""+name+"\")" else "with "+name+" = get_dummy_DB_time,", - datetime_field(attrs) then if attrs = none then "get_DB_datetime(lwa, \""+name+"\")" else "with "+name+" = get_dummy_DB_datetime,", - foreign_key(_,_) then "get_Int(lwa, \""+name+"\")", - integer_field then "get_Int(lwa, \""+name+"\")", - char_field(Int size) then "get_String(lwa, \""+name+"\")", - text_field then "get_String(lwa, \""+name+"\")" - }. - -define List(String) -/* return the list of all columns name - */ - _to_List_String - ( - List(HK_Model_Column) columns, - Bool with_pk, - List(String) so_far - )= - if columns is - { - [] then reverse(so_far), - [h . t ] then - since h is hk_column(name, _, _, _), - if name = "id" & with_pk = false then - _to_List_String(t, with_pk, so_far) - else - _to_List_String(t, with_pk, [ name . so_far]) - }. - -public define List(String) -/* return the list of all columns name - */ - to_List_String - ( - List(HK_Model_Column) columns, - Bool with_pk - )= - _to_List_String(columns, with_pk, []). - -public define String - generate_constructor - ( - String constructor_name, - List(HK_Model_Column) columns, - String indent - )= - indent+constructor_name+"(\n"+indent+" "+join(",\n"+indent+" ", to_List_String(columns, true))+")". - -public define String - to_Bind - ( - HK_Model_Field t, - String type_name, //name of the type - String name, //name of component into the type - Bool insert //true if insert time else false for update - ) = - if t is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then "", - //binary then "constant_byte_array(0,0)", - boolean_field then "bind_Bool(\":v_"+name+"\", "+type_name+"."+name+")", - date_field(attrs) then "bind_Date(\":v_"+name+"\", "+type_name+"."+name+")", - time_field(attrs) then "bind_Time(\":v_"+name+"\", "+type_name+"."+name+")", - datetime_field(attrs) then if attrs is - { - none then "bind_Datetime(\":v_"+name+"\", "+type_name+"."+name+")", - auto_now then "bind_Datetime(\":v_"+name+"\", now)", - auto_now_add then - if insert then - "bind_Datetime(\":v_"+name+"\", now)" - else - "" - }, - foreign_key(_,_) then "bind_Int(\":v_"+name+"\", "+type_name+"."+name+")", - integer_field then "bind_Int(\":v_"+name+"\", "+type_name+"."+name+")", - char_field(Int size) then "bind_String(\":v_"+name+"\", "+type_name+"."+name+")", - text_field then "bind_String(\":v_"+name+"\", "+type_name+"."+name+")" - }. - -public define List(String) -/** - */ - to_Bind_list - ( - List(HK_Model_Column) columns, - String type_name, //name of the type - List(String) so_far, - Bool insert - )= - if columns is - { - [] then reverse(so_far), - [h . t ] then - since h is hk_column(name, col_type, _, _), - with result = to_Bind(col_type, type_name, name, insert), - //we eliminate the empty string because during the join it will have an empty line - if result = "" then - to_Bind_list(t, type_name, so_far, insert) - else - to_Bind_list(t, type_name, [result . so_far], insert) - }. - -public define String - generate_Bind_list - ( - List(HK_Model_Column) columns, - String type_name, - String indent, - Bool insert - )= - indent+"[\n"+indent+" "+join(",\n"+indent+" ", to_Bind_list(columns, type_name, [], insert))+"]". - - -public define Maybe(String) - get_column_name - ( - HK_Model_Column col, - Bool insert //true if insert time else false for update - ) = - since col is hk_column(name, col_type, _, _), - if col_type is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then failure, - //binary then "constant_byte_array(0,0)", - boolean_field then success(name), - date_field(attrs) then success(name), - time_field(attrs) then success(name), - datetime_field(attrs) then if attrs is - { - none then success(name), - auto_now then success(name), - auto_now_add then - if insert then success(name) else failure - }, - foreign_key(_,_) then success(name), - integer_field then success(name), - char_field(Int size) then success(name), - text_field then success(name) - }. - -public define List(String) - columns_name - ( - List(HK_Model_Column) columns, - Bool insert, //true if insert time else false for update - List(String) so_far - ) = - if columns is - { - [] then reverse(so_far), - [h . t] then - if get_column_name(h, insert) is - { - failure then columns_name(t, insert, so_far) - success(result) then - if insert then - columns_name(t, insert, [result . so_far]) - else - columns_name(t, insert, [enclose("\\\"",result)+" = :v_"+result . so_far]) - } - }. - -public define String -/* - Generate the SQL "(xxx, yyy, ...) VALUES ( :v_xxx, :v_yyy, ...)" for the insert - SQL query. - */ - insert_values - ( - List(HK_Model_Column) columns, - String indent - )= - with columns_list = columns_name(columns, true, []), - indent+" ("+join(", ", enclose("\\\"",columns_list))+")\n"+indent+"VALUES\n"+indent+" ("+prefixed_join(":v_", columns_list, ", ")+")". - - -public define String -/* - Generate the SQL "xxx = :v_xxx, yyy = :v_yyy, ..." for the update - SQL query. - */ - update_values - ( - List(HK_Model_Column) columns, - String indent - )= - with columns_list = columns_name(columns, false, []), - indent+" "+join(", ", columns_list). - - -public define Maybe(String) - get_VT_edit_entry - ( - HK_Model_Column col, - String type_name - ) = - since col is hk_column(name, col_type, _, help), - if col_type is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then success("primary_key(to_String("+type_name+"."+name+"))"), - //binary then "constant_byte_array(0,0)", - boolean_field then success("boolean(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), - date_field(attrs) then if attrs is - { - none then success("date(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".date, "+to_Anubis_source(help)+")"), - auto_now then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".date, "+to_Anubis_source(help)+")"), - auto_now_add then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".date, "+to_Anubis_source(help)+")") - }, - time_field(attrs) then if attrs is - { - none then success("time(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".time, "+to_Anubis_source(help)+")"), - auto_now then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".time, "+to_Anubis_source(help)+")"), - auto_now_add then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".time, "+to_Anubis_source(help)+")") - }, - datetime_field(attrs) then if attrs is - { - none then success("datetime(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".datetime, "+to_Anubis_source(help)+")"), - auto_now then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".datetime, "+to_Anubis_source(help)+")"), - auto_now_add then success("information(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+".datetime, "+to_Anubis_source(help)+")") - }, - foreign_key(app,foreign_table) then success("foreign_text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", vt_edit_selector(get_selector_"+foreign_table+"), "+to_Anubis_source(help)+")"), - integer_field then success("integer(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), - char_field(Int size) then success("text(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")"), - text_field then success("text_area(\""+to_upper(name)+"\", \""+name+"\", "+type_name+"."+name+", "+to_Anubis_source(help)+")") - }. - -public define String - edit_entries - ( - List(HK_Model_Column) columns, - String type_name, - String indent, - List(String) so_far - ) = - if columns is - { - [] then indent+" "+join(",\n"+indent+" ", reverse(so_far)), - [h . t] then - if get_VT_edit_entry(h, type_name) is - { - failure then edit_entries(t, type_name, indent, so_far) - success(result) then edit_entries(t, type_name, indent, [result . so_far]) - } - }. - -public define String - make_list_view_header - ( - List(String) list_view, - String indent - )= - indent+join(",\n"+indent, map((String text) |-> "text(\""+to_upper(text)+"\")", list_view)). - -public define Maybe(HK_Model_Column) - get_column_type - ( - List(HK_Model_Column) columns, //columns in wich we search - String name_to_find //Column name to find in previous list - )= - if columns is - { - [] then failure, - [h . t] then - since h is hk_column(name, _, _, _), - if name_to_find = name then - success(h) - else - get_column_type(t, name_to_find) - }. - -public define String -/** to_String return the String of the given model of the column 'col' - */ - to_String - ( - HK_Model_Column col, - String current_type_name, - String general_type_name - ) = - since col is hk_column(name, col_type, _, _), - if col_type is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then "get_"+general_type_name+"_show_string(db, "+current_type_name+".id)", - //binary then "constant_byte_array(0,0)", - boolean_field then "to_String("+current_type_name+"."+name+")", - date_field(attrs) then "to_String("+current_type_name+"."+name+")", - time_field(attrs) then "to_String("+current_type_name+"."+name+")", - datetime_field(attrs) then "to_String("+current_type_name+"."+name+")" - foreign_key(app,foreign_table) then "get_"+foreign_table+"_show_string(db, "+current_type_name+"."+name+")", - integer_field then "to_String("+current_type_name+"."+name+")", - char_field(Int size) then current_type_name+"."+name, - text_field then current_type_name+"."+name - }. - -public define String -/** to_String return the String of the given model of the column 'col' - */ - to_Icon - ( - HK_Model_Column col, - String current_type_name, - String general_type_name - ) = - since col is hk_column(name, col_type, _, _), - if col_type is - { - p_key then icn16_key, - boolean_field then "to_Icon("+current_type_name+"."+name+")", - date_field(attrs) then icn16_clock, - time_field(attrs) then icn16_clock, - datetime_field(attrs) then icn16_clock, - foreign_key(app,foreign_table) then icn16_question, - integer_field then icn16_question, - char_field(Int size) then icn16_question, - text_field then icn16_question - }. - -public define String - to_HTML_cell_text - ( - HK_Model_Column column, - String data_name, - String general_type_name - )= - "text("+to_String(column, data_name, general_type_name)+")". - -public define String - to_HTML_cell_link - ( - HK_Model_Column column, - String data_name, - String general_type_name - )= - "link(to_String("+data_name+".id), "+to_String(column, data_name, general_type_name)+")". - -public define String - to_HTML_cell_link - ( - List(HK_Model_Column) columns, - String column_name, - String data_name, - String general_type_name - )= - if get_column_type(columns, column_name) is - { - failure then "column name "+column_name+"doesn't exist", - success(column) then to_HTML_cell_link(column, data_name, general_type_name) - }. - -public define String - to_HTML_cell_icon - ( - HK_Model_Column column, - String data_name, - String general_type_name - )= - "icon("+to_Icon(column, data_name, general_type_name)+")". - - -public define String - to_HTML_cell - ( - List(HK_Model_Column) columns, - String column_name, - String data_name, - String general_type_name - )= - if get_column_type(columns, column_name) is - { - failure then "column name "+column_name+"doesn't exist", - success(column) then - since column is hk_column(name, col_type, _, _), - if col_type is - { - //anubis(_T) then "constant_byte_array(0,0)", - p_key then to_HTML_cell_link(column, data_name, general_type_name), - //binary then "constant_byte_array(0,0)", - boolean_field then to_HTML_cell_icon(column, data_name, general_type_name), - date_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name), - time_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name), - datetime_field(attrs) then to_HTML_cell_text(column, data_name, general_type_name), - foreign_key(app,foreign_table) then to_HTML_cell_text(column, data_name, general_type_name), - integer_field then to_HTML_cell_text(column, data_name, general_type_name), - char_field(Int size) then to_HTML_cell_text(column, data_name, general_type_name), - text_field then to_HTML_cell_text(column, data_name, general_type_name), - } - }. - -public define String - make_list_view_row - ( - HK_Table table, //table to format - String data_name, //name of data - String indent, //indentation string to use - HK_List_View list_view //list view to generate - )= - since table is hk_table(table_name, short, model, _), //get name and model of the table - since model is hk_model( columns, _), //get all columns of table -// since display is db_display(views, _), // - with current_list_column = if list_view is - { - list_view_all then to_List_String(columns, false), //generate a list of columns string to view from columns model - list_view(v_name, v_col) then v_col - }, - - if current_list_column is - { - [] then "", - [h . t] then - indent+join(",\n"+indent, - //Make first column as link - [to_HTML_cell_link(columns, h, data_name, table_name)] + - - //and the other set with list_view - map((String column_name) |-> to_HTML_cell(columns, column_name, data_name, table_name), t) - ) - }. + + + + -- libgit2 0.21.4