From 58acb7ccf46881708f7552ad303fb156603c29d2 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 15 Nov 2023 07:46:12 +0100 Subject: Return list of BXD --- gn/db/mysql.scm | 22 +++++++++++++++++----- gn/db/sparql.scm | 9 +++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'gn') diff --git a/gn/db/mysql.scm b/gn/db/mysql.scm index c84605d..e35cc69 100644 --- a/gn/db/mysql.scm +++ b/gn/db/mysql.scm @@ -1,3 +1,7 @@ +#! + 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) @@ -5,11 +9,19 @@ #: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 ( - open-db - ) -) + db-check + )) -(define open-db - #t) +(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)))))) diff --git a/gn/db/sparql.scm b/gn/db/sparql.scm index c413b9a..b7d94f3 100644 --- a/gn/db/sparql.scm +++ b/gn/db/sparql.scm @@ -1,3 +1,12 @@ +#! + +Module for handling SPARQL primitives. + +Note that GN queries should go into gn/data - this is currently not +the case. + +!# + (define-module (gn db sparql) #:use-module (json) #:use-module (ice-9 match) -- cgit v1.2.3