diff options
author | Pjotr Prins | 2023-11-15 07:46:12 +0100 |
---|---|---|
committer | Pjotr Prins | 2023-11-15 07:46:12 +0100 |
commit | 58acb7ccf46881708f7552ad303fb156603c29d2 (patch) | |
tree | 3138cc8484d6e934bc901110f2580bc041574668 /gn | |
parent | 12e43794a12a94e45c25cadf5d167697c16c4f5f (diff) | |
download | gn-guile-58acb7ccf46881708f7552ad303fb156603c29d2.tar.gz |
Return list of BXD
Diffstat (limited to 'gn')
-rw-r--r-- | gn/db/mysql.scm | 22 | ||||
-rw-r--r-- | gn/db/sparql.scm | 9 |
2 files changed, 26 insertions, 5 deletions
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) |