flow-models/models/gold/testnet/testnet__fact_transactions.sql
2025-09-17 11:49:32 -06:00

38 lines
783 B
SQL

{{ config(
materialized = 'view',
tags = ['testnet', 'testnet_gold']
) }}
SELECT
tx_id,
block_timestamp,
block_height :: INT AS block_height,
'flow' AS chain_id,
proposer,
payer,
authorizers,
count_authorizers,
gas_limit,
script,
arguments,
OBJECT_CONSTRUCT(
'error',
error_message,
'events',
events,
'status',
status
) AS transaction_result,
tx_succeeded,
error_message AS error_msg,
COALESCE (
streamline_transaction_id,
{{ dbt_utils.generate_surrogate_key(['tx_id']) }}
) AS fact_transactions_id,
inserted_timestamp,
modified_timestamp
FROM
{{ ref('silver__testnet_transactions_final') }}
WHERE
NOT pending_result_response