summaryrefslogtreecommitdiff
path: root/src/playground.lisp
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2009-06-25 18:22:55 +0200
committerLinus Nordberg <linus@nordberg.se>2009-06-25 18:22:55 +0200
commit572da882f6d26355d9fd284bc29be15209fed8ff (patch)
treeecf116dacf8518242081ac8a2178e06c0cb3de39 /src/playground.lisp
parent6d3b3259a7c7e8d26faaf606ab6715b22942a1d5 (diff)
Store timestamp and precision-time in db.
Diffstat (limited to 'src/playground.lisp')
-rw-r--r--src/playground.lisp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/playground.lisp b/src/playground.lisp
index 5cc1336..bc11db6 100644
--- a/src/playground.lisp
+++ b/src/playground.lisp
@@ -89,10 +89,20 @@
;;
(next-xml-blurb (new-reader "victoria.tug.nordu.net" 50001) "BGP_MESSAGE")
-;;
+;;;; db
+;; SQL
+"select * from bgp_message where timestamp != 0 order by id desc limit 3;"
+
+;; postmodern, lower level
+;; http://common-lisp.net/project/postmodern/postmodern.html#querying
+(query "select count(*) from bgp_message" :single)
(doquery (:select 'timestamp 'prefix 'label :from 'bgp-message)
(ts pref lbl)
(format t "~A ~A ~A~%" ts pref lbl))
-(select-dao 'bgp-message)
+;; postmodern, higher level
+;; http://common-lisp.net/project/postmodern/postmodern.html#tabledef
+(dolist (m (select-dao 'bgp-message (:= 'label "NANN")))
+ (format t "~A ~A ~A~%" (timestamp m) (prefix m) (label m)))
+(length (select-dao 'bgp-message))