X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fsql.lisp;h=0a733aa81035c787e3a12d2c51bf0eb010b4f5a2;hp=64f74739a0e33ca3bd6c586f3300bceab0544773;hb=aad71482a312cf287e2f6e3e926cf671cd382ec7;hpb=8373c592f525a394a1ff66986ad4acf50e8e11b7 diff --git a/sql/sql.lisp b/sql/sql.lisp index 64f7473..0a733aa 100644 --- a/sql/sql.lisp +++ b/sql/sql.lisp @@ -71,7 +71,10 @@ default value of T, which specifies that minimum sizes are computed. The output stream is given by STREAM, which has a default value of T. This specifies that *STANDARD-OUTPUT* is used." (flet ((compute-sizes (data) - (mapcar #'(lambda (x) (apply #'max (mapcar #'length x))) + (mapcar #'(lambda (x) + (apply #'max (mapcar #'(lambda (y) + (if (null y) 3 (length y))) + x))) (apply #'mapcar (cons #'list data)))) (format-record (record control sizes) (format stream "~&~?" control @@ -80,7 +83,8 @@ value of T. This specifies that *STANDARD-OUTPUT* is used." (let* ((query-exp (etypecase query-exp (string query-exp) (sql-query (sql-output query-exp database)))) - (data (query query-exp :database database)) + (data (query query-exp :database database :result-types nil + :field-names nil)) (sizes (if (or (null sizes) (listp sizes)) sizes (compute-sizes (if titles (cons titles data) data)))) (formats (if (or (null formats) (not (listp formats)))