From 5e4d73370cce03c6f0ca54738110611e487d7a40 Mon Sep 17 00:00:00 2001 From: ckonstanski Date: Mon, 27 Jul 2026 21:54:30 -0600 Subject: stuff --- src/record.lisp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/record.lisp') diff --git a/src/record.lisp b/src/record.lisp index 9502899..cbd79e2 100644 --- a/src/record.lisp +++ b/src/record.lisp @@ -160,6 +160,15 @@ on those slots." (field-value-pairs record) (expand-where-expression record (*where-expression record))))) +(defmethod update-query-no-nulls ((record record)) + (if (null (*where-expression record)) + (error 'org-ckons-condition::handled-error (format nil "Attempting to update a record of type ~a, but it has no *WHERE-EXPRESSION" (type-of record))) + (format nil + "UPDATE ~a SET ~a~a" + (org-ckons-core::format-list (if (slot-exists-p record '*write-table) (slot-value record '*write-table) (slot-value record '*table)) `(,(*project record))) + (field-value-pairs-no-nulls record) + (expand-where-expression record (*where-expression record))))) + (defmethod select-query ((record record)) (format nil "SELECT ~a FROM ~a" @@ -180,6 +189,9 @@ on those slots." (defmethod update-record* ((record record)) (execute-command (update-query record))) +(defmethod update-record-no-nulls* ((record record)) + (execute-command (update-query-no-nulls record))) + (defmethod select-records-impl* ((record record) where-expression order-by-clause) (let* ((where-string (expand-where-expression record where-expression)) (order-by-string (if (org-ckons-core::null-or-empty-p order-by-clause) -- cgit v1.3