diff --git a/src/core/dao.lisp b/src/core/dao.lisp index 546bf3a..39f6093 100644 --- a/src/core/dao.lisp +++ b/src/core/dao.lisp @@ -53,8 +53,6 @@ #:delete-by-values #:save-dao #:select-dao - #:*want-cursor* - #:fetch-dao #:select-by-sql #:includes #:include-foreign-objects @@ -216,8 +214,7 @@ (make-mito-cursor :cursor cursor :class class)))) -(defun fetch-dao (cursor) - (check-type cursor mito-cursor) +(defun fetch-dao-from-cursor (cursor) (let ((row (dbi:fetch (mito-cursor-cursor cursor) :format :alist))) (when row @@ -456,7 +453,7 @@ (let* ((*want-cursor* t) (,cursor ,select)) (loop ,@(and index `(for ,index from 0)) - for ,dao = (fetch-dao ,cursor) + for ,dao = (fetch-dao-from-cursor ,cursor) while ,dao do (progn ,@body))))) (if (dbi:in-transaction *connection*) diff --git a/t/dao.lisp b/t/dao.lisp index 2adb71d..2903965 100644 --- a/t/dao.lisp +++ b/t/dao.lisp @@ -261,13 +261,13 @@ (cursor (mito.dao:select-dao 'user (where (:like :name "%aro"))))) (ok (typep cursor 'mito.dao::mito-cursor)) - (let ((row (mito.dao:fetch-dao cursor))) + (let ((row (mito.dao::fetch-dao-from-cursor cursor))) (ok (typep row 'user)) (ok (equal (slot-value row 'name) "Eitaro"))) - (let ((row (mito.dao:fetch-dao cursor))) + (let ((row (mito.dao::fetch-dao-from-cursor cursor))) (ok (typep row 'user)) (ok (equal (slot-value row 'name) "Btaro"))) - (ok (null (mito.dao:fetch-dao cursor))))) + (ok (null (mito.dao::fetch-dao-from-cursor cursor))))) (let ((records '())) (do-cursor (dao (mito.dao:select-dao 'user) i)