X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=sql%2Fclasses.lisp;h=80d735c1ee07eed15b4a6d13f20d35116382477f;hp=d1d8ff79a2885a0f4bf7df7a5c915aead099d7b1;hb=21ae7203d719886a1f044992e463d5f463727ac0;hpb=760cf506d0395b2140f9c83c2f3d00a147262bf9 diff --git a/sql/classes.lisp b/sql/classes.lisp index d1d8ff7..80d735c 100644 --- a/sql/classes.lisp +++ b/sql/classes.lisp @@ -100,8 +100,7 @@ (call-next-method))))) (defmethod output-sql ((expr sql-ident) database) - (with-slots (name) - expr + (with-slots (name) expr (write-string (convert-to-db-default-case (etypecase name @@ -586,9 +585,7 @@ uninclusive, and the args from that keyword to the end." (write-string " FROM " *sql-stream*) (typecase from (list (output-sql (apply #'vector from) database)) - (string (write-string - (sql-escape - (convert-to-db-default-case from database)) *sql-stream*)) + (string (write-string from *sql-stream*)) (t (output-sql from database)))) (when inner-join (write-string " INNER JOIN " *sql-stream*) @@ -664,7 +661,11 @@ uninclusive, and the args from that keyword to the end." (with-slots (into attributes values query) ins (write-string "INSERT INTO " *sql-stream*) - (output-sql into database) + (output-sql + (typecase into + (string (sql-expression :attribute into)) + (t into)) + database) (when attributes (write-char #\Space *sql-stream*) (output-sql attributes database)) @@ -770,7 +771,8 @@ uninclusive, and the args from that keyword to the end." (write-char #\Space *sql-stream*) (write-string (if (stringp db-type) db-type ; override definition - (database-get-type-specifier (car type) (cdr type) database)) + (database-get-type-specifier (car type) (cdr type) database + (database-underlying-type database))) *sql-stream*) (let ((constraints (database-constraint-statement (if (and db-type (symbolp db-type))