MCPcopy Create free account
hub / github.com/rilldata/rill / UpdateDeviceAuthCode

Method UpdateDeviceAuthCode

admin/database/postgres/postgres.go:1778–1781  ·  view source on GitHub ↗
(ctx context.Context, id, userID string, approvalState database.DeviceAuthCodeState)

Source from the content-addressed store, hash-verified

1776}
1777
1778func (c *connection) UpdateDeviceAuthCode(ctx context.Context, id, userID string, approvalState database.DeviceAuthCodeState) error {
1779 res, err := c.getDB(ctx).ExecContext(ctx, "UPDATE device_auth_codes SET approval_state=$1, user_id=$2, updated_on=now() WHERE id=$3", approvalState, userID, id)
1780 return checkUpdateRow("device auth code", res, err)
1781}
1782
1783func (c *connection) DeleteExpiredDeviceAuthCodes(ctx context.Context, retention time.Duration) error {
1784 _, err := c.getDB(ctx).ExecContext(ctx, "DELETE FROM device_auth_codes WHERE expires_on + $1 < now()", retention)

Callers

nothing calls this directly

Calls 3

getDBMethod · 0.95
checkUpdateRowFunction · 0.85
ExecContextMethod · 0.45

Tested by

no test coverage detected