mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
* feat: Add anonymized telemetry to report product usage This adds a background service to report telemetry to a Coder server for usage data. There will be realtime event data sent in the future, but for now usage will report on a CRON. * Fix flake and requested changes * Add reporting options for setup * Add reporting for workspaces * Add resources as they are reported * Track API key usage * Ensure telemetry is tracked prior to exit
27 lines
671 B
SQL
27 lines
671 B
SQL
-- name: GetWorkspaceAppsByAgentID :many
|
|
SELECT * FROM workspace_apps WHERE agent_id = $1;
|
|
|
|
-- name: GetWorkspaceAppsByAgentIDs :many
|
|
SELECT * FROM workspace_apps WHERE agent_id = ANY(@ids :: uuid [ ]);
|
|
|
|
-- name: GetWorkspaceAppByAgentIDAndName :one
|
|
SELECT * FROM workspace_apps WHERE agent_id = $1 AND name = $2;
|
|
|
|
-- name: GetWorkspaceAppsCreatedAfter :many
|
|
SELECT * FROM workspace_apps WHERE created_at > $1;
|
|
|
|
-- name: InsertWorkspaceApp :one
|
|
INSERT INTO
|
|
workspace_apps (
|
|
id,
|
|
created_at,
|
|
agent_id,
|
|
name,
|
|
icon,
|
|
command,
|
|
url,
|
|
relative_path
|
|
)
|
|
VALUES
|
|
($1, $2, $3, $4, $5, $6, $7, $8) RETURNING *;
|