(defmethod output-sql ((expr sql-assignment-exp) database)
(with-slots (operator sub-expressions)
- expr
- (do ((sub sub-expressions (cdr sub)))
- ((null (cdr sub)) (output-sql (car sub) database))
- (output-sql (car sub) database)
+ expr
+ (output-sql (car sub-expressions) database)
+ (dolist (sub (cdr sub-expressions))
(write-char #\Space *sql-stream*)
(%write-operator operator database)
- (write-char #\Space *sql-stream*)))
+ (write-char #\Space *sql-stream*)
+ (output-sql sub database)))
t)
(defclass sql-value-exp (%sql-expression)
(remove-duplicates tabs :test #'database-identifier-equal))
nil)))
-
-
(defmethod output-sql ((expr sql-value-exp) database)
(with-slots (modifier components)
expr
(setf (aref buf j) #\'))
((and (char= char #\\)
;; MTP: only escape backslash with pgsql/mysql
- (member (database-underlying-type database)
- '(:postgresql :mysql)
- :test #'eq))
+ (database-escape-backslashes database))
(setf (aref buf j) #\\)
(incf j)
(setf (aref buf j) #\\))
returns nil if there are no children"
(clsql-ors clauses))
+
+(defclass sql-escape-string-exp (%sql-expression)
+ ((string
+ :initarg :string
+ :initform nil))
+ (:documentation
+ "An escaped string string expression (postgresql E'stuff') ."))
+
+(defmethod output-sql ((exp sql-escape-string-exp) database)
+ (with-slots (string) exp
+ (when string
+ (write-char #\E *sql-stream*)
+ (output-sql string database))))