X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=sql%2Fexpressions.lisp;h=4f0baf1230b0ab32353dc69026645306adae11e0;hb=HEAD;hp=10bdb5ec0b2a0dd23e7d85032da5f180e1b45315;hpb=374df8f34a7214e08fc4cfc5d734d024acdbf9ca;p=clsql.git diff --git a/sql/expressions.lisp b/sql/expressions.lisp index 10bdb5e..4f0baf1 100644 --- a/sql/expressions.lisp +++ b/sql/expressions.lisp @@ -450,8 +450,6 @@ (remove-duplicates tabs :test #'database-identifier-equal)) nil))) - - (defmethod output-sql ((expr sql-value-exp) database) (with-slots (modifier components) expr @@ -1108,7 +1106,9 @@ uninclusive, and the args from that keyword to the end." (ecase (database-underlying-type database) (:mssql "IDENTITY (1,1)") ((:sqlite :sqlite3) "PRIMARY KEY AUTOINCREMENT") - (:mysql "AUTO_INCREMENT"))) + (:mysql "AUTO_INCREMENT") + ;; this is modeled as a datatype instead of a constraint + (:postgresql ""))) ;; everything else just get the name (T (string-upcase (symbol-name constraint))))) @@ -1232,3 +1232,16 @@ uninclusive, and the args from that keyword to the end." 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))))