aboutsummaryrefslogtreecommitdiff
path: root/gn/db
diff options
context:
space:
mode:
authorPjotr Prins2025-09-21 10:29:09 +0200
committerPjotr Prins2025-09-21 10:29:09 +0200
commitb3ba723fca7bf67e8d78f23089f0150f52b44e20 (patch)
treecf3e34f496203b01c565a6fccfc4f5a18759fc4e /gn/db
parentc7b30c964e7190868aeb7ba87649544f42d525ad (diff)
downloadgn-guile-b3ba723fca7bf67e8d78f23089f0150f52b44e20.tar.gz
Working on aging links
Diffstat (limited to 'gn/db')
-rw-r--r--gn/db/mysql.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm
index 0d7cd40..223b5fd 100644
--- a/gn/db/mysql.scm
+++ b/gn/db/mysql.scm
@@ -32,23 +32,23 @@
;; (display "===> OPENING DB")
;; (newline)
(let [(db (dbi-open "mysql" "webqtlout:webqtlout:db_webqtl:tcp:127.0.0.1:3306"))]
- (ensure db)
+ (ensure db "Can't open connection")
db
)))
(define (call-with-db thunk)
(thunk (db-open)))
-(define (ensure db)
+(define (ensure db msg1)
"Use DBI-style handle to report an error. On error the program will stop."
(match (dbi-get_status db)
((stat . msg) (if (= stat 0)
#t
(begin
(display "SQL Connection ERROR! ")
- (display msg)
+ (display (string-append msg1 " - " msg)
(newline)
- (assert stat))))))
+ (assert #f)))))))
(define (has-result? db)
"Return #t or #f if result is valid"