#! Module for handling SQL DB primitives. Note that GN queries should go into gn/data !# (define-module (gn db mysql) #:use-module (json) #:use-module (ice-9 match) #:use-module (ice-9 format) #:use-module (ice-9 iconv) #:use-module (ice-9 receive) #:use-module (ice-9 string-fun) #:use-module (rnrs base) #:use-module (dbi dbi) #:export ( db-check )) (define (db-check db) "Use DBI-style handle to report an error" (match (dbi-get_status db) ((stat . msg) (if (= stat 0) #t (begin (display msg) (newline) (assert stat))))))