lightning-terminal/db/sqlc/queries/actions.sql
Viktor Torstensson 5d8f03e241
sqlc+firewalldb: add GetAction SQL query
Add a new SQL query `GetAction` to retrieve a single action by its ID.
This query will be needed for the kvdb to SQL migration of actions
store.
2025-10-07 02:13:14 +02:00

21 lines
No EOL
506 B
SQL

-- name: InsertAction :one
INSERT INTO actions (
session_id, account_id, macaroon_identifier, actor_name, feature_name, action_trigger,
intent, structured_json_data, rpc_method, rpc_params_json, created_at,
action_state, error_reason
) VALUES (
$1, $2, $3, $4, $5, $6,
$7, $8, $9, $10, $11, $12, $13
) RETURNING id;
-- name: SetActionState :exec
UPDATE actions
SET action_state = $1,
error_reason = $2
WHERE id = $3;
-- name: GetAction :one
SELECT *
FROM actions
WHERE id = $1;