/* * Created by PyramIDE. * User: Totoro * Date: 14/11/2011 * Time: 22:41 * */ transmit tools/basis.anubis transmit tools/ISO-8601.anubis /* DB_id will is deprecated. Please use next version below all upper case */ public type DB_id: none, db_id(Int value). public type DB_ID: none, pk(Int value). public type DB_datetime: db_datetime(String datetime). //Date and time in ISO8601 format "YYYY-MM-DD hh:mm:ss" public type DB_date: db_date(String date). //Date in ISO8601 format "YYYY-MM-DD" public type DB_time: db_time(String time). //Time in ISO8601 format "hh:mm:ss" public type DB_integer: db_integer(Int value). public define String to_String ( DB_id idx )= if idx is { none then "none", db_id(_idx) then abs_to_decimal(_idx) }. public define Int to_Int ( DB_id idx )= if idx is { none then (Int)-1, db_id(_idx) then _idx }. public define String to_String ( DB_ID idx )= if idx is { none then "none", pk(_idx) then abs_to_decimal(_idx) }. public define Int to_Int ( DB_ID idx )= if idx is { none then (Int)-1, pk(_idx) then _idx }. public define String to_String ( DB_date d )= date(d). public define String to_String ( DB_datetime dt )= datetime(dt). public define String to_String ( DB_time t )= time(t). public define String to_DBString ( Bool value )= if value then "1" else "0". public define Int to_DBInt ( Bool value )= if value then 1 else 0. public type SQLite3_update_field: field(String column, SQLite3Bind bind). * Some Bind helper * /********** Some default type values ********************/ public define DB_datetime get_dummy_DB_datetime = db_datetime(""). public define DB_datetime now = db_datetime(_Int_to_ISO_8601_datetime(now)). public define DB_time get_dummy_DB_time = db_time(""). public define DB_date get_dummy_DB_date = db_date("").