From e7eb4371da02065a6742833f509f81801ccfa2ab Mon Sep 17 00:00:00 2001 From: Erik Mackdanz Date: Sun, 14 Dec 2025 14:11:08 -0600 Subject: [PATCH] db_get_schema, simplify --- gptel | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gptel b/gptel index 7bdaf23..83dbe5f 100644 --- a/gptel +++ b/gptel @@ -351,13 +351,9 @@ (gptel-make-tool :name "db_get_schema" :function (lambda (callback) - (let ((output-buffer (generate-new-buffer "*query-output*"))) - (call-process-region "" nil "pg_dump" nil output-buffer t "--schema-only" "llm") - ;; (message "Get schema output: %s" (with-current-buffer output-buffer (buffer-string))) - (with-current-buffer output-buffer - (funcall callback (buffer-string)) - ) - (kill-buffer output-buffer) + (with-temp-buffer + (call-process-region "" nil "pg_dump" nil t t "--schema-only" "llm") + (funcall callback (buffer-string)) )) :description "Dump the schema of the sample PostgreSQL database" :async t -- 2.52.0