diff options
author | Arun Isaac | 2021-12-23 16:46:24 +0530 |
---|---|---|
committer | Arun Isaac | 2021-12-23 16:46:24 +0530 |
commit | 289bdd9c8c1b579e8e36d74677144fac105e6a3f (patch) | |
tree | 097842dee85bc9f62fe457d5d97e39d55f0b4894 | |
parent | 3aff5fa35efd8437acaf8bea33285ba8ab298a5c (diff) | |
download | gn-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.
-rwxr-xr-x | dump.scm | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -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)) |