-- name: job__insert :exec
INSERT INTO runtime_manager_jobs (
    id,
    command_id,
    job_type,
    status,
    priority,
    job_input_json,
    lease_owner,
    lease_token_hash,
    lease_until,
    claim_attempt,
    slot_id,
    agent_run_id,
    project_id,
    repository_id,
    release_line_id,
    package_installation_id,
    fleet_scope_id,
    cluster_id,
    requested_by,
    created_at,
    started_at,
    finished_at,
    next_action,
    last_error_code,
    last_error_message,
    short_log_tail,
    full_log_ref,
    updated_at,
    version
) VALUES (
    @id,
    @command_id,
    @job_type,
    @status,
    @priority,
    @job_input_json::jsonb,
    @lease_owner,
    @lease_token_hash,
    @lease_until,
    @claim_attempt,
    @slot_id::uuid,
    @agent_run_id::uuid,
    @project_id::uuid,
    @repository_id::uuid,
    @release_line_id::uuid,
    @package_installation_id::uuid,
    @fleet_scope_id::uuid,
    @cluster_id::uuid,
    @requested_by::uuid,
    @created_at,
    @started_at,
    @finished_at,
    @next_action,
    @last_error_code,
    @last_error_message,
    @short_log_tail,
    @full_log_ref,
    @updated_at,
    @version
);
