forked from ermine/sulci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
muc_sql.ml
37 lines (31 loc) · 1.19 KB
/
muc_sql.ml
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
(* DO NOT EDIT MANUALLY *)
(* *)
(* generated by sqlgg 0.2.3-49-g30df037 on 2010-01-14T17:45Z *)
module Make (T : Sqlgg_traits.M) = struct
let create_muc db =
T.execute db "CREATE TABLE IF NOT EXISTS muc (room text, nick text, lang text, chatlog char(1))" T.no_params
let select_rooms db callback =
let invoke_callback stmt =
callback
(T.get_column_Text stmt 0)
(T.get_column_Text stmt 1)
(T.get_column_Text stmt 2)
(T.get_column_Text stmt 3)
in
T.select db "SELECT room, nick, lang, chatlog FROM muc" T.no_params invoke_callback
module Fold = struct
let create_muc db =
T.execute db "CREATE TABLE IF NOT EXISTS muc (room text, nick text, lang text, chatlog char(1))" T.no_params
let select_rooms db callback acc =
let invoke_callback stmt =
callback
(T.get_column_Text stmt 0)
(T.get_column_Text stmt 1)
(T.get_column_Text stmt 2)
(T.get_column_Text stmt 3)
in
let r_acc = ref acc in
T.select db "SELECT room, nick, lang, chatlog FROM muc" T.no_params (fun x -> r_acc := invoke_callback x !r_acc);
!r_acc
end (* module Fold *)
end (* module Make *)