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
  
//! The NULL Sql handler. 
//! 
//! This is an empty Sql handler typically used to test other 
//! functionality of the Sql module. 
 
#pike __REAL_VERSION__ 
 
inherit __builtin.Sql.Connection; 
 
//! @returns 
//!   @expr{@[sprintf]("quote(%q)", s)@}. 
string quote(string s) 
{ 
  return sprintf("quote(%q)", s); 
} 
 
//! @returns 
//!   Returns an array with a single element: 
//!   @mapping 
//!     @member string "query" 
//!       The query string before formating. 
//!     @member string "bindings_query" 
//!       The query string before bindings having been inserted. 
//!     @member string "formatted_query" 
//!       The formatted query. 
//!   @endmapping 
variant Sql.Result big_query(string query) 
{ 
  return Sql.sql_array_result(({([ 
                                  "query":query, 
                                  "bindings_query":query, 
                                  "formatted_query":query, 
                                ])})); 
} 
 
//! @returns 
//!   Returns an array with a single element: 
//!   @mapping 
//!     @member string "query" 
//!       The query string before formating. 
//!     @member string "bindings_query" 
//!       The query string before bindings having been inserted. 
//!     @member string "bindings" 
//!       @expr{@[sprintf]("%O", @[bindings])@}. 
//!     @member string "formatted_query" 
//!       The formatted query. 
//!   @endmapping 
variant Sql.Result big_query(string query, mapping bindings) 
{ 
  Sql.Result res = ::big_query(query, bindings); 
 
  res->_values[0]->bindings = sprintf("%O", bindings); 
  res->_values[0]->query = query; 
  res->_values[0]->bindings_query = query; 
  return res; 
} 
 
//! @returns 
//!   Returns an array with a single element: 
//!   @mapping 
//!     @member string "query" 
//!       The query string before formating. 
//!     @member string "bindings_query" 
//!       The query string before bindings having been inserted. 
//!     @member string "bindings" 
//!       @expr{@[sprintf]("%O", @[bindings])@}. 
//!     @member string "formatted_query" 
//!       The formatted query. 
//!     @member string "args" 
//!       @expr{@[sprintf]("%O", ({@[extraarg]}) + extraargs)@}. 
//!   @endmapping 
variant Sql.Result big_query(string query, 
                             string|int|float|object extraarg, 
                             string|int|float|object ... extraargs) 
{ 
  Sql.Result res = ::big_query(query, extraarg, @extraargs); 
 
  res->_values[0]->query = query; 
  res->_values[0]->args = sprintf("%O", ({ extraarg }) + extraargs); 
  return res; 
}