X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Fsql.lisp;h=21f5371b905685dd5e092914bc8491d44148b77b;hb=cc92d162f24648d65ad872098353305a5baf91d7;hp=28d5a922b857a4f9dd9387f497ddcc02d5a7c2f1;hpb=79dacf4fb7e6707e815c3e8072e5c809acaa9386;p=clsql.git diff --git a/sql/sql.lisp b/sql/sql.lisp index 28d5a92..21f5371 100644 --- a/sql/sql.lisp +++ b/sql/sql.lisp @@ -38,11 +38,14 @@ (clsql-base-sys::signal-no-database-error database)) (unless (is-database-open database) (database-reconnect database)) - (dolist (table (list-tables database)) + (when (db-type-has-views? (database-underlying-type database)) + (dolist (view (list-views :database database)) + (drop-view view :database database))) + (dolist (table (list-tables :database database)) (drop-table table :database database)) - (dolist (index (list-indexes database)) + (dolist (index (list-indexes :database database)) (drop-index index :database database)) - (dolist (seq (list-sequences database)) + (dolist (seq (list-sequences :database database)) (drop-sequence seq :database database))) (defun print-query (query-exp &key titles (formats t) (sizes t) (stream t) @@ -217,6 +220,10 @@ condition is true." (declare (ignore database)) (db-timestring self)) +(defmethod database-output-sql ((self duration) database) + (declare (ignore database)) + (format nil "'~a'" (duration-timestring self))) + (defmethod database-output-sql (thing database) (if (or (null thing) (eq 'null thing))