Commit 75714b34 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

csv export from raspberry pi

parent 32c76fe3
......@@ -446,7 +446,7 @@
(lambda (kt r)
(if (equal? r "") (string-append "\"" (ktv-key kt) "\"")
(string-append r ", \"" (ktv-key kt) "\"")))
"id, "
"\"id\""
(get-attribute-ids/types db table entity-type)))
(define (csv db table entity-type)
......@@ -474,7 +474,7 @@
(string-append r ", \"" (get-entity-name db "sync" (ktv-value ktv)) "\""))
(else
(string-append r ", \"" (stringify-value-url ktv) "\""))))
(vector-ref res 1) ;; unique_id
(string-append "\"" (vector-ref res 1) "\"") ;; unique_id
entity))))
(csv-titles db table entity-type)
(cdr (db-select
......@@ -614,6 +614,7 @@
(asserteq "cleaning" (length (dirty-entities db table)) 0)
(msg (csv db table "thing"))
(msg (db-status db))
)
......
......@@ -75,6 +75,18 @@
(scheme->txt
(send-entity db table unique-id)))))
(register
(req 'entity-types '(table))
(lambda (table)
(pluto-response
(scheme->txt
(get-all-entity-types db table)))))
(register
(req 'entity-csv '(table type))
(lambda (table type)
(pluto-response
(csv db table type))))
))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment