Commit 2e8d5143a99bf1bcb532ce7191df3f6f575aabb7

Authored by totoro
1 parent 5dbb61cb

change read by transmit and some cleanup

Showing 1 changed file with 75 additions and 76 deletions   Show diff stats
database/db_types.anubis
1 -/*  
2 - * Created by PyramIDE.  
3 - * User: Totoro  
4 - * Date: 14/11/2011  
5 - * Time: 22:41  
6 - *  
7 - * To change this template use Tools | Options | Coding | Edit Standard Headers.  
8 - */  
9 -read tools/basis.anubis  
10 -  
11 -public type DB_id:  
12 - none,  
13 - db_id(Int value).  
14 -  
15 -public type DB_datetime:  
16 - datetime(String datetime).  
17 -  
18 -public type DB_date:  
19 - date(String date).  
20 -  
21 -public type DB_integer:  
22 - db_integer(Int value).  
23 -  
24 -  
25 -public define String  
26 - to_String  
27 - (  
28 - DB_id idx  
29 - )=  
30 - if idx is  
31 - {  
32 - none then "none",  
33 - db_id(idx) then abs_to_decimal(idx)  
34 - }.  
35 -  
36 -public define String  
37 - to_String  
38 - (  
39 - DB_date d  
40 - )=  
41 - date(d).  
42 -  
43 -  
44 -  
45 -public define String  
46 - to_String  
47 - (  
48 - DB_datetime d  
49 - )=  
50 - datetime(d).  
51 -  
52 -  
53 -  
54 -public define String  
55 - to_DBString  
56 - (  
57 - Bool value  
58 - )=  
59 - if value then "1" else "0".  
60 -  
61 -public define Int  
62 - to_DBInt  
63 - (  
64 - Bool value  
65 - )=  
66 - if value then 1 else 0.  
67 -  
68 -public type SQLite3_update_field:  
69 - field(String column, SQLite3Bind bind).  
70 -  
71 -  
72 - * Some Bind helper *  
73 -  
74 -  
75 -  
76 - 1 +/*
  2 + * Created by PyramIDE.
  3 + * User: Totoro
  4 + * Date: 14/11/2011
  5 + * Time: 22:41
  6 + *
  7 + */
  8 +transmit tools/basis.anubis
  9 +
  10 +public type DB_id:
  11 + none,
  12 + db_id(Int value).
  13 +
  14 +public type DB_datetime:
  15 + datetime(String datetime).
  16 +
  17 +public type DB_date:
  18 + date(String date).
  19 +
  20 +public type DB_integer:
  21 + db_integer(Int value).
  22 +
  23 +
  24 +public define String
  25 + to_String
  26 + (
  27 + DB_id idx
  28 + )=
  29 + if idx is
  30 + {
  31 + none then "none",
  32 + db_id(idx) then abs_to_decimal(idx)
  33 + }.
  34 +
  35 +public define String
  36 + to_String
  37 + (
  38 + DB_date d
  39 + )=
  40 + date(d).
  41 +
  42 +
  43 +
  44 +public define String
  45 + to_String
  46 + (
  47 + DB_datetime d
  48 + )=
  49 + datetime(d).
  50 +
  51 +
  52 +
  53 +public define String
  54 + to_DBString
  55 + (
  56 + Bool value
  57 + )=
  58 + if value then "1" else "0".
  59 +
  60 +public define Int
  61 + to_DBInt
  62 + (
  63 + Bool value
  64 + )=
  65 + if value then 1 else 0.
  66 +
  67 +public type SQLite3_update_field:
  68 + field(String column, SQLite3Bind bind).
  69 +
  70 +
  71 + * Some Bind helper *
  72 +
  73 +
  74 +
  75 +