diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-07-17 18:45:43 +0300 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-07-19 18:32:12 +0300 |
| commit | f793203e043aaa2db38823c84500e82756348ac0 (patch) | |
| tree | 88a8a7b78069427f11acb0f2040e9f1d391fab55 /query | |
| parent | aaea258a21226a893025a65222e244c6b3f4454c (diff) | |
Added session duration metrics with device analytics along with device
analytics metrics in the DB to aggregate and DeviceID abuse prevention
Diffstat (limited to 'query')
| -rw-r--r-- | query/device_analytics.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/query/device_analytics.sql b/query/device_analytics.sql new file mode 100644 index 0000000..92287af --- /dev/null +++ b/query/device_analytics.sql @@ -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 *; |
