tracking: rename time-stamp to timestamp
This commit is contained in:
parent
dafce6f2d2
commit
5930e8a594
1 changed files with 6 additions and 8 deletions
|
@ -9,7 +9,7 @@
|
||||||
(:util :scopes/util)
|
(:util :scopes/util)
|
||||||
(:alx :alexandria)
|
(:alx :alexandria)
|
||||||
(:jzon :com.inuoe.jzon))
|
(:jzon :com.inuoe.jzon))
|
||||||
(:export #:track #:trackid #:time-stamp
|
(:export #:track #:trackid #:timestamp
|
||||||
#:container #:table-name #:storage #:make-item
|
#:container #:table-name #:storage #:make-item
|
||||||
#:get-track #:query-last #:query-one #:query
|
#:get-track #:query-last #:query-one #:query
|
||||||
#:save #:insert #:update
|
#:save #:insert #:update
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
(defclass track (shape:record)
|
(defclass track (shape:record)
|
||||||
((trackid :accessor trackid :initform nil)
|
((trackid :accessor trackid :initform nil)
|
||||||
(time-stamp :accessor time-stamp :initform nil)
|
(timestamp :accessor timestamp :initform nil)
|
||||||
(container :reader container :initarg :container)))
|
(container :reader container :initarg :container)))
|
||||||
|
|
||||||
(defun timestamp-to-sql (tr ts)
|
(defun timestamp-to-sql (tr ts)
|
||||||
|
@ -112,8 +112,6 @@
|
||||||
(destructuring-bind (f v &optional op) spec
|
(destructuring-bind (f v &optional op) spec
|
||||||
(unless v
|
(unless v
|
||||||
(setf v ""))
|
(setf v ""))
|
||||||
(when (eql f :time-stamp)
|
|
||||||
(setf f :timestamp))
|
|
||||||
(unless op
|
(unless op
|
||||||
(setf op (if (eql f :timestamp) :>= :=)))
|
(setf op (if (eql f :timestamp) :>= :=)))
|
||||||
(when (symbolp v)
|
(when (symbolp v)
|
||||||
|
@ -130,20 +128,20 @@
|
||||||
(shape:head-fields tr))))
|
(shape:head-fields tr))))
|
||||||
(setf (shape:head tr) hv)
|
(setf (shape:head tr) hv)
|
||||||
(setf (trackid tr) (getf row :trackid))
|
(setf (trackid tr) (getf row :trackid))
|
||||||
(setf (time-stamp tr) (getf row :timestamp))
|
(setf (timestamp tr) (getf row :timestamp))
|
||||||
(setf (shape:data tr)
|
(setf (shape:data tr)
|
||||||
(funcall *build-track-data*
|
(funcall *build-track-data*
|
||||||
(jzon:parse (getf row :data) :key-fn #'util:to-keyword)))
|
(jzon:parse (getf row :data) :key-fn #'util:to-keyword)))
|
||||||
tr)))
|
tr)))
|
||||||
|
|
||||||
(defun ensure-timestamp (track)
|
(defun ensure-timestamp (track)
|
||||||
(if (not (time-stamp track))
|
(if (not (timestamp track))
|
||||||
(setf (time-stamp track) (get-universal-time))))
|
(setf (timestamp track) (get-universal-time))))
|
||||||
|
|
||||||
(defun plist (track &optional data)
|
(defun plist (track &optional data)
|
||||||
(let ((vl (shape:head-plist track))
|
(let ((vl (shape:head-plist track))
|
||||||
(data (or data (shape:data track))))
|
(data (or data (shape:data track))))
|
||||||
(with-slots ((trid trackid) (ts time-stamp)) track
|
(with-slots ((trid trackid) (ts timestamp)) track
|
||||||
(when trid (setf (getf vl :trackid) trid))
|
(when trid (setf (getf vl :trackid) trid))
|
||||||
(when ts (setf (getf vl :timestamp) (timestamp-to-sql track ts)))
|
(when ts (setf (getf vl :timestamp) (timestamp-to-sql track ts)))
|
||||||
(when data
|
(when data
|
||||||
|
|
Loading…
Add table
Reference in a new issue