From f6109d54a74de1094f5334c63d44f7c90ff501b4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 20 Dec 2021 16:24:54 +0530 Subject: Capture full column type. Capture full column type instead of just whether it is an integer. * dump.scm (dump-data-table): Capture full column type in object. * dump/table.scm ()[int?]: Delete member. [type]: New member. Export column-type instead of column-int?. --- dump.scm | 3 +-- dump/table.scm | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dump.scm b/dump.scm index ccf85ca..e35b377 100755 --- a/dump.scm +++ b/dump.scm @@ -510,8 +510,7 @@ is a object." (set-table-columns table (sql-map (lambda (row) (make-column (assoc-ref row "Field") - (or (string-prefix? "int" (assoc-ref row "Type")) - (string-prefix? "smallint" (assoc-ref row "Type"))))) + (assoc-ref row "Type"))) db (format #f "SHOW COLUMNS FROM ~a" (table-name table))))) (sql-map (lambda (row) diff --git a/dump/table.scm b/dump/table.scm index 1a9abc6..8f6a128 100644 --- a/dump/table.scm +++ b/dump/table.scm @@ -7,7 +7,7 @@ set-table-columns make-column column-name - column-int?)) + column-type)) (define-immutable-record-type
(make-table name size columns) @@ -17,7 +17,7 @@ (columns table-columns set-table-columns)) (define-immutable-record-type - (make-column name int?) + (make-column name type) column? (name column-name) - (int? column-int?)) + (type column-type)) -- cgit v1.2.3