50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
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
|
-
+
+
+
+
+
+
+
+
+
+
+
|
(if (config-lookup *configdat* "setup" "synchronous")
(begin
(debug:print 5 "INFO: Turning off pragma synchronous")
(sqlite3:execute db "PRAGMA synchronous = 0;"))
(debug:print 5 "INFO: NOT turning off pragma synchronous"))
db))
(define (open-run-close proc idb . params)
(define (open-run-close proc idb . params)
(let* ((db (if idb idb (open-db)))
(res (apply proc db params)))
(if (not idb)(sqlite3:finalize! db))
res))
(define *global-delta* 0)
(define (open-run-close-measure proc idb . params)
(let* ((start-ms (current-milliseconds))
(db (if idb idb (open-db)))
(res (apply proc db params)))
(if (not idb)(sqlite3:finalize! db))
(set! *global-delta* (- (current-milliseconds) start-ms))
(print "INFO: delta=" *global-delta*)
res))
(define (db:initialize db)
(let* ((configdat (car *configinfo*)) ;; tut tut, global warning...
(keys (config-get-fields configdat))
(havekeys (> (length keys) 0))
(keystr (keys->keystr keys))
(fieldstr (keys->key/field keys)))
|