-- name: repository_adoption_scan__insert :one
INSERT INTO provider_hub_repository_adoption_scan_snapshots (
    id,
    snapshot_key,
    provider_operation_id,
    external_account_id,
    provider_slug,
    repository_full_name,
    provider_repository_id,
    repository_url,
    default_branch,
    requested_ref,
    scanned_ref,
    head_sha,
    status,
    markers_json,
    file_count,
    visible_file_count,
    tree_truncated,
    warnings_json,
    snapshot_digest,
    observed_at,
    version,
    created_at,
    updated_at
) VALUES (
    @id,
    @snapshot_key,
    @provider_operation_id,
    @external_account_id,
    @provider_slug,
    @repository_full_name,
    @provider_repository_id,
    @repository_url,
    @default_branch,
    @requested_ref,
    @scanned_ref,
    @head_sha,
    @status,
    @markers_json,
    @file_count,
    @visible_file_count,
    @tree_truncated,
    @warnings_json,
    @snapshot_digest,
    @observed_at,
    @version,
    @created_at,
    @updated_at
)
ON CONFLICT (provider_operation_id) DO NOTHING
RETURNING
    id,
    snapshot_key,
    provider_operation_id,
    external_account_id,
    provider_slug,
    repository_full_name,
    provider_repository_id,
    repository_url,
    default_branch,
    requested_ref,
    scanned_ref,
    head_sha,
    status,
    markers_json,
    file_count,
    visible_file_count,
    tree_truncated,
    warnings_json,
    snapshot_digest,
    observed_at,
    version,
    created_at,
    updated_at;
