X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=sql%2Frecording.lisp;h=02bb972adf186d8cdfa7b5950d31e998fc2884e2;hb=1a446890f95ab363af82529a133546d722ef21b1;hp=8bff3352442835d5d4a38038f5f9887586c6dc69;hpb=5be31565b7d87b90f0e79a9e61af84ad05e12920;p=clsql.git diff --git a/sql/recording.lisp b/sql/recording.lisp index 8bff335..02bb972 100644 --- a/sql/recording.lisp +++ b/sql/recording.lisp @@ -1,8 +1,6 @@ ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- ;;;; ************************************************************************* ;;;; -;;;; $Id$ -;;;; ;;;; CLSQL broadcast streams which can be used to monitor the ;;;; flow of commands to, and results from, a database. ;;;; @@ -50,7 +48,7 @@ by passing TYPE value of :both." (defun sql-recording-p (&key (type :commands) (database *default-database*)) "Predicate to test whether the SQL recording specified by TYPE -is currently enabled for DATABASE which defaults to *DEFAULT-DATABASE*. +is currently enabled for DATABASE which defaults to *DEFAULT-DATABASE*. TYPE may be one of :commands, :results, :both or :either, defaulting to :commands, otherwise nil is returned." (when (or (and (eq type :commands) @@ -88,7 +86,7 @@ both." (cons stream (list-sql-streams :type :results :database database)))))) stream) - + (defun delete-sql-stream (stream &key (type :commands) (database *default-database*)) "Removes the supplied stream STREAM from the recording broadcast @@ -142,12 +140,12 @@ returned is that used for recording SQL commands or results." (result-recording-stream database)) (t (error "Unknown recording type. ~A" type)))) - + (defun record-sql-command (expr database) (when database (with-slots (command-recording-stream) database - (when command-recording-stream + (when command-recording-stream (format command-recording-stream "~&;; ~A ~A => ~A~%" (iso-timestring (get-time)) (database-name database) @@ -157,11 +155,11 @@ returned is that used for recording SQL commands or results." (when database (with-slots (result-recording-stream) database - (when result-recording-stream + (when result-recording-stream (format result-recording-stream "~&;; ~A ~A <= ~A~%" (iso-timestring (get-time)) (database-name database) res))))) - +