model.anubis 650 Bytes
/*
 * Created by PyramIDE.
 * User: フランスのトトロ aka (David RENÉ) 
 * Date: 13/02/2016
 * Time: 11:01
 * © Calexium 
 */

read system/string.anubis

read hayamiki_lib/types/hayamiki.anubis

public define String
  format_attributes
  (
    List(HK_Model_Attr)  attributes
  )=
  join(" ",map((HK_Model_Attr attr) |->
    if attr is
    {
      unique        then "UNIQUE",    
      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)).