mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 18:36:12 +02:00
Add a restart-case for interactive debugging.
When dealing with MATERIALIZING VIEWS test cases and failing in the middle of them, as it happens when fixing bugs, then it was tedious (to say the least) to clean-up manually the view each time. That said, for end-users, doing it automatically would risk cleaning-up the wrong view definition if they had a typo in their pgloader command, say. Common Lisp helps a lot here: we simply create a restart that is only available interactively for the developers of pgloader!
This commit is contained in:
parent
7b08b6e3d3
commit
25152f6054
@ -22,7 +22,20 @@
|
||||
for sql = (format nil "CREATE VIEW ~a AS ~a" name def)
|
||||
do
|
||||
(log-message :info "MySQL: ~a" sql)
|
||||
(mysql-query sql))))))
|
||||
#+pgloader-image
|
||||
(mysql-query sql)
|
||||
#-pgloader-image
|
||||
(restart-case
|
||||
(mysql-query sql)
|
||||
(use-existing-view ()
|
||||
:report "Use the already existing view and continue"
|
||||
nil)
|
||||
(replace-view ()
|
||||
:report "Replace the view with the one from pgloader's command"
|
||||
(let ((drop-sql (format nil "DROP VIEW ~a;" name)))
|
||||
(log-message :info "MySQL: ~a" drop-sql)
|
||||
(mysql-query drop-sql)
|
||||
(mysql-query sql)))))))))
|
||||
|
||||
(defun drop-my-views (views-alist)
|
||||
"See `create-my-views' for VIEWS-ALIST description. This time we DROP the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user