Something went wrong. Try again.
(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
Something went wrong. Try again.
1234567891011121314151617181920212223242526-- name: CreateAPIKey :execINSERT INTO api_keys (id, owner_did, name, key_hash, created_at, uri, cid)VALUES ($1, $2, $3, $4, $5, $6, $7)ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name, key_hash = EXCLUDED.key_hash, uri = EXCLUDED.uri, cid = EXCLUDED.cid;
-- name: GetAPIKeysByOwner :manySELECT id, owner_did, name, key_hash, created_at, last_used_atFROM api_keysWHERE owner_did = $1ORDER BY created_at DESC;
-- name: GetAPIKeyByHash :oneSELECT id, owner_did, name, key_hash, created_at, last_used_atFROM api_keysWHERE key_hash = $1;
-- name: UpdateAPIKeyLastUsed :execUPDATE api_keys SET last_used_at = $1 WHERE id = $2;
-- name: DeleteAPIKeyReturningURI :oneDELETE FROM api_keys WHERE id = $1 AND owner_did = $2 RETURNING uri;