put methods directly into generic definition
This commit is contained in:
parent
b168015309
commit
723ae93c83
1 changed files with 6 additions and 7 deletions
|
@ -30,13 +30,16 @@
|
|||
(params :initarg :params)
|
||||
(config :reader config :initarg :config)))
|
||||
|
||||
(defclass db-engine-pg (db-engine) ())
|
||||
|
||||
(defun make-engine ()
|
||||
(let ((backend (getf *db-config* :backend)))
|
||||
(funcall (getf *backends* backend) *db-config*)))
|
||||
|
||||
(defgeneric timestamp-to-sql (engine ts))
|
||||
|
||||
(defmethod timestamp-to-sql ((engine db-engine) ts) ts)
|
||||
(defgeneric timestamp-to-sql (engine ts)
|
||||
(:method ((engine db-engine) ts) ts)
|
||||
(:method ((engine db-engine-pg) ts)
|
||||
(format nil "~a" (local-time:universal-to-timestamp ts))))
|
||||
|
||||
(defclass storage ()
|
||||
((engine :reader engine :initarg :engine)
|
||||
|
@ -98,7 +101,3 @@
|
|||
:connect #'(lambda ()
|
||||
(apply #'dbi:connect-cached db-type conn-args)))))
|
||||
|
||||
(defclass db-engine-pg (db-engine) ())
|
||||
|
||||
(defmethod timestamp-to-sql ((engine db-engine-pg) ts)
|
||||
(format nil "~a" (local-time:universal-to-timestamp ts)))
|
||||
|
|
Loading…
Add table
Reference in a new issue