diff options
Diffstat (limited to 'examples/schema.scm')
| -rwxr-xr-x | examples/schema.scm | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/examples/schema.scm b/examples/schema.scm index 5d74d27..c4ff082 100755 --- a/examples/schema.scm +++ b/examples/schema.scm @@ -8,18 +8,7 @@ (transform sql) (transform table)) -(define (call-with-genenetwork-database connection-settings proc) - (call-with-database "mysql" (string-join - (list (assq-ref connection-settings 'sql-username) - (assq-ref connection-settings 'sql-password) - (assq-ref connection-settings 'sql-database) - "tcp" - (assq-ref connection-settings 'sql-host) - (number->string - (assq-ref connection-settings 'sql-port))) - ":") - proc)) - + (define (transform-table-schema connection-settings db) (let ((tables (tables connection-settings db))) (for-each (lambda (table) @@ -37,14 +26,14 @@ (for-each (lambda (column) (let ((column-id (column-id (table-name table) (column-name column)))) - (triple column-id 'rdf:type 'gn:sqlTableField) + (triple column-id 'rdf:type 'gn:sql_table_field) (triple column-id 'gn:name (column-name column)) - (triple column-id 'gn:sqlFieldType (column-type column)) - (triple table-id 'gn:hasField column-id))) + (triple column-id 'gn:sql_field_type (column-type column)) + (triple table-id 'gn:has_field column-id))) (table-columns table)))) tables))) - + (let* ((option-spec '((settings (single-char #\s) (value #t)) (output (single-char #\o) (value #t)) @@ -54,7 +43,7 @@ (output (option-ref options 'output #f)) (documentation (option-ref options 'documentation #f)) (%connection-settings (call-with-input-file settings read))) - (call-with-genenetwork-database + (call-with-target-database %connection-settings (lambda (db) (with-output-to-file output |
