aboutsummaryrefslogtreecommitdiff
path: root/dump.scm
diff options
context:
space:
mode:
authorArun Isaac2021-12-23 16:46:24 +0530
committerArun Isaac2021-12-23 16:46:24 +0530
commit289bdd9c8c1b579e8e36d74677144fac105e6a3f (patch)
tree097842dee85bc9f62fe457d5d97e39d55f0b4894 /dump.scm
parent3aff5fa35efd8437acaf8bea33285ba8ab298a5c (diff)
downloadgn-transform-databases-289bdd9c8c1b579e8e36d74677144fac105e6a3f.tar.gz
Disambiguate user and User tables in RDF identifier.
* dump.scm (dump-schema, column-id): Disambiguate user and User tables in RDF identifier.
Diffstat (limited to 'dump.scm')
-rwxr-xr-xdump.scm16
1 files changed, 14 insertions, 2 deletions
diff --git a/dump.scm b/dump.scm
index 5be830a..882438b 100755
--- a/dump.scm
+++ b/dump.scm
@@ -199,7 +199,12 @@ ALIST field-name) forms."
(define (column-id table-name column-name)
(string->identifier
- "field" (string-append table-name "__" column-name)))
+ "field" (string-append
+ ;; We downcase table names in identifiers. So, we
+ ;; distinguish between the user and User tables.
+ (if (string=? table-name "User")
+ "user2" table-name)
+ "__" column-name)))
(define-syntax define-dump
(lambda (x)
@@ -598,7 +603,14 @@ is a <table> object."
(define (dump-schema db)
(let ((tables (tables db)))
(for-each (lambda (table)
- (let ((table-id (string->identifier "table" (table-name table))))
+ (let ((table-id (string->identifier
+ "table"
+ ;; We downcase table names in
+ ;; identifiers. So, we distinguish
+ ;; between the user and User tables.
+ (if (string=? (table-name table) "User")
+ "user2"
+ (table-name table)))))
(triple table-id 'rdf:type 'gn:sqlTable)
(triple table-id 'gn:name (table-name table))
(triple table-id 'gn:hasSize (table-size table))