+2015-04-06 Russ Tyndall <russ@acceleration.net>
+ * sql/operations, sql/expressions: add postgresql E-string
+ operator / expression. Needed for correct regex handling
+ EG: [E "some string"]=> E'some string'
+
2015-03-24 Russ Tyndall <russ@acceleration.net>
* sql/oodml.lisp: fixed call-next-method in the base of
read-sql-value and replaced with a continuable
(remove-duplicates tabs :test #'database-identifier-equal))
nil)))
-
-
(defmethod output-sql ((expr sql-value-exp) database)
(with-slots (modifier components)
expr
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))))
(make-instance 'sql-function-exp
:name 'all :args rest))
+(defsql sql-e-string (:symbol "E") (&rest rest)
+ (make-instance 'sql-escape-string-exp :string (first rest)))
+
(defsql sql-not (:symbol "not") (&rest rest)
(make-instance 'sql-value-exp
:modifier 'not :components rest))