Something went wrong. Try again.
the coolest token pot ever
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930-- name: CreateAPIKey :oneINSERT INTO api_keys ( id, user_id, key_hash, key_word, key_last4, name, max_budget_micros, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)RETURNING *;
-- name: GetAPIKeyByHash :oneSELECT * FROM api_keys WHERE key_hash = ? AND revoked_at IS NULL;
-- name: ListAPIKeysForUser :manySELECT * FROM api_keysWHERE user_id = ?ORDER BY created_at DESC;
-- name: RevokeAPIKey :execUPDATE api_keys SET revoked_at = ?WHERE id = ? AND user_id = ? AND revoked_at IS NULL;
-- name: RenameAPIKey :execUPDATE api_keys SET name = ?WHERE id = ? AND user_id = ?;
-- name: TouchAPIKey :exec-- Debounced caller: only call when last_used_at is older than 60s.UPDATE api_keys SET last_used_at = ? WHERE id = ?;
-- name: AddAPIKeySpend :execUPDATE api_keys SET spent_micros = spent_micros + ? WHERE id = ?;