This adds an RDB's CURSOR support to select-dao, which can reduce memory usage since it won't load whole results on memory.
A new macro do-cursor loops through rows one by one as a DAO:
(do-cursor (dao (select-dao 'user
(where (:< "2024-07-01" :created_at))))
;; Can be a more complex condition
(when (equal (user-name dao) "Eitaro")
(return dao)))
;; Same but without using CURSOR
(loop for dao in (select-dao 'user
(where (:< "2024-07-01" :created_at)))
when (equal (user-name dao) "Eitaro")
do (return dao))
This adds an RDB's CURSOR support to
select-dao
, which can reduce memory usage since it won't load whole results on memory.A new macro
do-cursor
loops through rows one by one as a DAO:It requires DBI v0.11.1 or above.