Commit 086ff2f7c7c68eed2079286b14b9b29e6c11a52a
1 parent
66ee1b04
+ add get_dummy_DB_XXXX where XXXX is datetime, time and date.
Those functions return Maybe(DB_XXXX) according to their type. This is useful when we parsing web_arg and the argument doesn't exist. For type constructor we need all component to be able to construct it. Hence these functions assume the role of getting argument value with dummy value. Generally the missing argument are optional or autonomous value (generated) during the insert or update like created_datetime or updated_datetime. + add now which return DB_datetime
Showing
1 changed file
with
23 additions
and
0 deletions
Show diff stats
database/db_types.anubis
| ... | ... | @@ -81,3 +81,26 @@ public type SQLite3_update_field: |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | |
| 84 | +/********** Some default type values ********************/ | |
| 85 | + | |
| 86 | +public define Maybe(DB_datetime) | |
| 87 | + get_dummy_DB_datetime | |
| 88 | + = | |
| 89 | + success(db_datetime("")). | |
| 90 | + | |
| 91 | +public define DB_datetime | |
| 92 | + now | |
| 93 | + = | |
| 94 | + _Int_to_ISO_8601_datetime(now). | |
| 95 | + | |
| 96 | + | |
| 97 | +public define Maybe(DB_time) | |
| 98 | + get_dummy_DB_time | |
| 99 | + = | |
| 100 | + success(db_time("")). | |
| 101 | + | |
| 102 | +public define Maybe(DB_date) | |
| 103 | + get_dummy_DB_date | |
| 104 | + = | |
| 105 | + success(db_date("")). | |
| 106 | + | ... | ... |