db_binds.anubis
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 17/03/2017
* Time: 00:14
* © Calexium
*/
extended version of bind for SQLite3.
public define SQLite3Bind
bind_DB_id_or_NULL
(
String _name,
DB_id _value
)=
if _value is
{
none then bind_NULL(_name)
db_id(value) then bind_Int(_name, value)
}
.
public define SQLite3Bind
bind_DB_id_or_NULL
(
String _name,
Maybe(DB_id) mb_value
)=
if mb_value is
{
failure then bind_NULL(_name)
success(id) then bind_DB_id_or_NULL(_name, id)
}
.
public define SQLite3Bind
bind_Int_or_NULL
(
String name,
Maybe(Int) mb_value
)=
if mb_value is
{
failure then bind_NULL(name),
success(value) then bind_Int(name, value)
}
.
public define SQLite3Bind
bind_String_or_NULL
(
String name,
String value
)=
if value = "" then
bind_NULL(name)
else
bind_String(name, value).
public define SQLite3Bind
bind_Datetime
(
String name,
DB_datetime dt
)=
bind_String(name, datetime(dt)).
public define SQLite3Bind
bind_Date
(
String name,
DB_date d
)=
bind_String(name, date(d)).
public define SQLite3Bind
bind_Time
(
String name,
DB_time d
)=
bind_String(name, time(d)).
public define SQLite3Bind
bind_Bool
(
String name,
Bool value
)=
bind_Int(name, to_DBInt(value)).
public define SQLite3Bind
bind_BLOB
(
String name,
$V value
)=
bind_ByteArray(name, serialize(value)).