Added session duration metrics with device analytics along with device

analytics metrics in the DB to aggregate and DeviceID abuse prevention
This commit is contained in:
2025-07-17 18:45:43 +03:00
parent aaea258a21
commit f793203e04
18 changed files with 230 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
-- name: SetDeviceAnalytics :one
INSERT INTO device_analytics (
device_id, os, arch, term, colorterm
) VALUES (
@device_id, @os, @arch, @term, @colorterm
)
ON CONFLICT DO
UPDATE SET
os = EXCLUDED.os, arch = EXCLUDED.arch, term = EXCLUDED.term, colorterm = EXCLUDED.colorterm
WHERE device_id = EXCLUDED.device_id
RETURNING *;