Commit df15cf4f664f85e110f8a835780f5e53a159f7e3

Authored by totoro
1 parent 3b23eec0

deprecate the DB_id to DB_ID

Showing 1 changed file with 30 additions and 1 deletions   Show diff stats
database/db_types.anubis
@@ -8,9 +8,14 @@ @@ -8,9 +8,14 @@
8 transmit tools/basis.anubis 8 transmit tools/basis.anubis
9 transmit tools/ISO-8601.anubis 9 transmit tools/ISO-8601.anubis
10 10
  11 +/* DB_id will is deprecated. Please use next version below all upper case */
11 public type DB_id: 12 public type DB_id:
12 none, 13 none,
13 db_id(Int value). 14 db_id(Int value).
  15 +
  16 +public type DB_ID:
  17 + none,
  18 + pk(Int value).
14 19
15 public type DB_datetime: 20 public type DB_datetime:
16 db_datetime(String datetime). //Date and time in ISO8601 format "YYYY-MM-DD hh:mm:ss" 21 db_datetime(String datetime). //Date and time in ISO8601 format "YYYY-MM-DD hh:mm:ss"
@@ -35,7 +40,7 @@ public define String @@ -35,7 +40,7 @@ public define String
35 none then "none", 40 none then "none",
36 db_id(_idx) then abs_to_decimal(_idx) 41 db_id(_idx) then abs_to_decimal(_idx)
37 }. 42 }.
38 - 43 +
39 public define Int 44 public define Int
40 to_Int 45 to_Int
41 ( 46 (
@@ -50,6 +55,30 @@ public define Int @@ -50,6 +55,30 @@ public define Int
50 public define String 55 public define String
51 to_String 56 to_String
52 ( 57 (
  58 + DB_ID idx
  59 + )=
  60 + if idx is
  61 + {
  62 + none then "none",
  63 + pk(_idx) then abs_to_decimal(_idx)
  64 + }.
  65 +
  66 +public define Int
  67 + to_Int
  68 + (
  69 + DB_ID idx
  70 + )=
  71 + if idx is
  72 + {
  73 + none then (Int)-1,
  74 + pk(_idx) then _idx
  75 + }.
  76 +
  77 +
  78 +
  79 +public define String
  80 + to_String
  81 + (
53 DB_date d 82 DB_date d
54 )= 83 )=
55 date(d). 84 date(d).