mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Attempt to set a proper FreeTDS buffer size.
Let's see what happens in the tests with that before cleaning up the API a little here, and maybe getting rid of the hardcoded "25000" rows.
This commit is contained in:
parent
f323625738
commit
f048e36838
@ -99,11 +99,20 @@
|
||||
(otherwise (error "not supported type ~A"
|
||||
(foreign-enum-keyword '%syb-value-type type))))))
|
||||
|
||||
(defconstant +dbbuffer+ 14)
|
||||
|
||||
(define-sybdb-function ("dbsetopt" %dbsetopt) %RETCODE
|
||||
(dbproc %DBPROCESS)
|
||||
(option :int)
|
||||
(char-param :pointer)
|
||||
(int-param :int))
|
||||
|
||||
(defun map-query-results (query &key row-fn (connection *database*))
|
||||
"Map the query results through the map-fn function."
|
||||
(let ((%dbproc (slot-value connection 'dbproc))
|
||||
(cffi:*default-foreign-encoding* (slot-value connection 'external-format)))
|
||||
(with-foreign-string (%nrows "25000")
|
||||
(%dbsetopt %dbproc +dbbuffer+ %nrows 0))
|
||||
(with-foreign-string (%query query)
|
||||
(%dbcmd %dbproc %query))
|
||||
(%dbsqlexec %dbproc)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user