cl-scopes/storage/tracking.lisp

27 lines
680 B
Common Lisp

;;; cl-scopes/storage/tracking.lisp
;;;; A simple generic (SQL-based) storage for tracks, messages, and other stuff.
(defpackage :scopes/storage/tracking
(:use :common-lisp)
(:export #:track #:time-stamp #:data
#:container
#:crtable))
(in-package :scopes/storage/tracking)
(defclass track ()
((head)
(time-stamp :reader time-stamp :accessor time-stamp!)
(data :accessor data :initform nil)
(container :initarg :container)))
(defclass container ()
((storage :initarg :storage)))
(defun crtable (tn)
(sxql:yield
(sxql:make-statement :create-table tn
(list
(list 'trackid :type 'bigserial :primary-key t)
(list 'taskid :type 'text)))))