                          "   AND UNIX_MILLIS(t-session_timezone()) > ?"
                          "   AND UNIX_MILLIS(t-session_timezone()) < ?"
                          " ORDER BY t")
-                    (get-series-id series-name)
+                    (intern-series-name series-name)
                     begin-t
                     end-t])))
 

      latest-t
      (let [query-latest-t (query-series-latest-sample-time series-name)]
        (swap! latest-sample-times assoc series-id query-latest-t)
        (log/info [:lst latest-sample-times])
        query-latest-t))))

(defn restrict-to-series [ samples series-name ]


(defquery store-data-samples [ samples ]
  (doseq [ sample samples ]
    (log/trace "Inserting sample: " sample)
    (let [series-id (intern-series-name (:series_name sample))]
      (check-latest-series-time series-id (:t sample))
      (jdbc/insert! *db* :sample
