cl-2sql

Lisp to SQL compiler for Common Lisp
git clone https://logand.com/git/cl-2sql.git/
Log | Files | Refs | README | LICENSE

commit 88caaac18fee707f5f051e0b63e9927cc6c0c717
parent c700e9be8e93b4b7f0ae633d71bc84ef8640702b
Author: Tomas Hlavaty <tom@logand.com>
Date:   Tue, 23 Aug 2011 00:27:09 +0200

dont use keywords in make-pdate|time|timestamp... constructors

Diffstat:
Morm.lisp | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/orm.lisp b/orm.lisp @@ -34,9 +34,11 @@ ;; (typep "hello" '(text 3)) ;; (typep "hello" '(text 3 2)) -(defstruct pdate y m d) -(defstruct ptime hh mm ss ms) -(defstruct ptimestamp-with-timezone date time timezone) +(defstruct (pdate (:constructor make-pdate (y m d))) y m d) +(defstruct (ptime (:constructor make-ptime (hh mm ss ms))) hh mm ss ms) +(defstruct (ptimestamp-with-timezone + (:constructor make-ptimestamp-with-timezone (date time timezone))) + date time timezone) ;;(defstruct pinterval y m d hh mm ss ms) (defmethod cl-postgres:to-sql-string ((a pdate)) @@ -490,10 +492,9 @@ ((typep value 'simple-date:timestamp) (setq value (multiple-value-bind (y m d hh mm ss ms) (simple-date:decode-timestamp value) - (make-ptimestamp-with-timezone - :date (make-pdate :y y :m m :d d) - :time (make-ptime :hh hh :mm mm :ss ss :ms ms) - :timezone nil)))) + (make-ptimestamp-with-timezone (make-pdate y m d) + (make-ptime hh mm ss ms) + nil)))) ((subtypep type 'persistent-object) (error "TODO assert-type persistent-object")))) ;;(print (list :assert-type2 value type (type-of value)))