Adapt to the new cl-ixf API.

This allows fixing bugs in processing the IXF files, which pgloader
directly benefits from.
This commit is contained in:
Dimitri Fontaine 2015-09-12 00:19:02 +02:00
parent a0dc59624c
commit a195ac6dd4
2 changed files with 10 additions and 11 deletions

View File

@ -67,8 +67,7 @@
(defun list-all-columns (ixf-stream table-name)
"Return the list of columns for the given IXF-FILE-NAME."
(let ((ixf:*ixf-stream* ixf-stream))
(let ((ixf (ixf:read-headers)))
(ixf:with-ixf-stream (ixf ixf-stream)
(list (cons table-name
(coerce (ixf:ixf-table-columns (ixf:ixf-file-table ixf))
'list))))))
'list)))))

View File

@ -59,12 +59,12 @@
"Extract IXF data and call PROCESS-ROW-FN function with a single
argument (a list of column values) for each row."
(with-connection (conn (source-db copy-ixf))
(let ((ixf:*ixf-stream* (conn-handle conn)))
(let ((ixf (ixf:read-headers))
(let ((ixf (ixf:make-ixf-file :stream (conn-handle conn)))
(row-fn (lambda (row)
(pgstate-incf *state* (target copy-ixf) :read 1)
(funcall process-row-fn row))))
(ixf:map-data ixf row-fn)))))
(ixf:read-headers ixf)
(ixf:map-data ixf row-fn))))
(defmethod copy-to-queue ((ixf copy-ixf) queue)
"Copy data from IXF file FILENAME into queue DATAQ"