Display dialog on query sql errors

This commit is contained in:
David Botton 2021-11-04 18:02:57 -04:00
parent 4019936821
commit 1aab69ec5e

View file

@ -85,7 +85,10 @@
'(("Query" :db-query)) '(("Query" :db-query))
(lambda (results) (lambda (results)
(when results (when results
(results-window app (cadr (assoc :db-query results))))) (handler-case
(results-window app (cadr (assoc :db-query results)))
(error (c)
(alert-dialog obj c :title "Error")))))
:title "Run Database Query" :height 200)))) :title "Run Database Query" :height 200))))
(defun on-query-non (obj) (defun on-query-non (obj)
@ -103,7 +106,7 @@
(results-window app "select changes()" :title (cadr (assoc :db-query results)))) (results-window app "select changes()" :title (cadr (assoc :db-query results))))
(error (c) (error (c)
(alert-dialog obj c :title "Error"))))) (alert-dialog obj c :title "Error")))))
:title "Run Database Query" :height 200)))) :title "Run Database Non-Query" :height 200))))
(defun edit-record (obj app table names data) (defun edit-record (obj app table names data)
(form-dialog obj "Edit Record" (form-dialog obj "Edit Record"