Skip to content

Commit

Permalink
Stop defining 'fetch' directly in postgres driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
fukamachi committed Aug 7, 2024
1 parent 629abec commit 26e1fd7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dbd/postgres.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@
(next-field field))
finally (return hash))))

(defmethod fetch ((cursor dbi-cursor) &key (format :plist))
(defmethod fetch-using-connection ((conn dbd-postgres-connection) (cursor dbi-cursor) format)
(unless (cursor-declared-p cursor)
(error "The cursor is not declared yet."))
(first
(exec-query (connection-handle (cursor-connection cursor))
(exec-query (connection-handle conn)
(format nil "FETCH ~A" (cursor-name cursor))
(ecase format
(:plist
Expand All @@ -216,7 +216,8 @@
(:values
'cl-postgres:list-row-reader)))))

(defmethod fetch ((query dbd-postgres-query) &key (format :plist))
(defmethod fetch-using-connection ((conn dbd-postgres-connection) (query dbi-query) format)
(declare (ignore conn))
(let ((fields (query-fields query))
(row (pop (query-results query))))
(ecase format
Expand Down

0 comments on commit 26e1fd7

Please sign in to comment.