commit a35f36e6bd765cf602d28d91981f27bc3cd680ba parent 480c1cd8d3f8179876d8105888397d399132c013 Author: Natasha Kerensikova <natgh@instinctive.eu> Date: Sat, 17 Feb 2024 11:09:06 +0000 Query arguments in function `write-query` Diffstat:
M | src/iens.scm | | | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/iens.scm b/src/iens.scm @@ -956,11 +956,14 @@ (load filename) (set! arg-replay old-arg-replay))) -(define (write-query text) - (query (for-each-row (lambda (row) (if (= 1 (length row)) - (write-line (->string (car row))) - (begin (write row) (newline))))) - (sql/transient db text))) +(define write-each-row + (for-each-row + (lambda (row) (if (= 1 (length row)) + (write-line (->string (car row))) + (begin (write row) (newline)))))) + +(define (write-query text . args) + (apply query write-each-row (sql/transient db text) args)) (defcmd (help) "" "Display this help"