lightning-terminal/db/sqlc/queries/actions.sql
Elle Mouton 65e4309f9c
db: add actions schemas and queries
In this commit we define the schema for the `actions` table along with
various queries we will need for interacting with the table. NOTE: we
will also add some of our own queries manually in commits to follow.
2025-05-29 07:04:40 +02:00

15 lines
444 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;