diff options
Diffstat (limited to 'src/playground.lisp')
-rw-r--r-- | src/playground.lisp | 14 |
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)) |