X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=sql%2Fobjects.lisp;h=9f61624d52ad875d6746626342421910405f6f63;hb=cc92d162f24648d65ad872098353305a5baf91d7;hp=e1bc241e09cdf26c4be92f3e9d1ff7517052063a;hpb=b89f494d185b0ba98b06175404704cc9d762e321;p=clsql.git diff --git a/sql/objects.lisp b/sql/objects.lisp index e1bc241..9f61624 100644 --- a/sql/objects.lisp +++ b/sql/objects.lisp @@ -234,6 +234,7 @@ superclass of the newly-defined View Class." (let ((cdef (list (sql-expression :attribute (view-class-slot-column slotdef)) (slot-type slotdef)))) + (setf cdef (append cdef (list (view-class-slot-db-type slotdef)))) (let ((const (view-class-slot-db-constraints slotdef))) (when const (setq cdef (append cdef (list const))))) @@ -543,7 +544,8 @@ DATABASE-NULL-VALUE on the type of the slot.")) (defmethod database-get-type-specifier (type args database) (declare (ignore type args)) - (if (member (database-type database) '(:postgresql :postgresql-socket)) + (if (clsql-base-sys::in (database-underlying-type database) + :postgresql :postgresql-socket) "VARCHAR" "VARCHAR(255)")) @@ -558,31 +560,32 @@ DATABASE-NULL-VALUE on the type of the slot.")) database) (if args (format nil "VARCHAR(~A)" (car args)) - (if (member (database-type database) '(:postgresql :postgresql-socket)) - "VARCHAR" - "VARCHAR(255)"))) + (if (clsql-base-sys::in (database-underlying-type database) + :postgresql :postgresql-socket) + "VARCHAR" + "VARCHAR(255)"))) (defmethod database-get-type-specifier ((type (eql 'simple-string)) args database) (if args (format nil "VARCHAR(~A)" (car args)) - (if (member (database-type database) '(:postgresql :postgresql-socket)) - "VARCHAR" - "VARCHAR(255)"))) + (if (clsql-base-sys::in (database-underlying-type database) + :postgresql :postgresql-socket) + "VARCHAR" + "VARCHAR(255)"))) (defmethod database-get-type-specifier ((type (eql 'string)) args database) (if args (format nil "VARCHAR(~A)" (car args)) - (if (member (database-type database) '(:postgresql :postgresql-socket)) - "VARCHAR" - "VARCHAR(255)"))) + (if (clsql-base-sys::in (database-underlying-type database) + :postgresql :postgresql-socket) + "VARCHAR" + "VARCHAR(255)"))) (defmethod database-get-type-specifier ((type (eql 'wall-time)) args database) (declare (ignore args)) - (case (database-type database) - (:postgresql - "TIMESTAMP WITHOUT TIME ZONE") - (:postgresql-socket + (case (database-underlying-type database) + ((:postgresql :postgresql-socket) "TIMESTAMP WITHOUT TIME ZONE") (:mysql "DATETIME")