(defun number-to-sql-string (num)
(etypecase num
(integer
- num)
+ (princ-to-string num))
(rational
(float-to-sql-string (coerce num 'double-float)))
(number
(defun sql-escape (identifier)
"Change hyphens to underscores, ensure string"
- (let* ((unescaped (etypecase identifier
- (symbol (symbol-name identifier))
- (string identifier)))
- (escaped (make-string (length unescaped))))
+ (let ((unescaped (etypecase identifier
+ (symbol (symbol-name identifier))
+ (string identifier))))
(substitute #\_ #\- unescaped)))
(defmacro without-interrupts (&body body)