summaryrefslogblamecommitdiff
path: root/db/query.sql
blob: cfea3f12dfa473bc1ff02eca56baa955f60be8b7 (plain) (tree)
1
2
3
4
5
6
7
8
9





                                                    


                                                                 
-- name: EnterUsage :exec
INSERT INTO Usage (
  HardwareAddr, StartTime, StopTime, Egress, Ingress
) VALUES (
  $1, $2, $3, $4, $5
);

-- name: GetUsage :one
SELECT SUM(Ingress) AS Ingress, SUM(Egress) AS Egress FROM Usage;