summaryrefslogtreecommitdiff
path: root/src/record.lisp
diff options
context:
space:
mode:
authorckonstanski <kostcarl@isu.edu>2026-07-27 21:54:30 -0600
committerckonstanski <kostcarl@isu.edu>2026-07-27 21:54:30 -0600
commit5e4d73370cce03c6f0ca54738110611e487d7a40 (patch)
tree3c58459135d88d317af6ff41157116c496287c20 /src/record.lisp
parent971073a01f4793f0f6165f7bd53a110c6ce6ed9f (diff)
stuff
Diffstat (limited to 'src/record.lisp')
-rw-r--r--src/record.lisp12
1 files changed, 12 insertions, 0 deletions
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)