@@ -1040,10 +1040,10 @@ JOIN assets_meta
1040
1040
ON assets .meta_data_id = assets_meta .meta_id
1041
1041
WHERE assets .asset_id = $1 ;
1042
1042
1043
+ -- name: UpsertMintAnchorUniCommitment :one
1043
1044
-- Upsert a record into the mint_anchor_uni_commitments table.
1044
1045
-- If a record with the same batch ID and tx output index already exists, update
1045
1046
-- the existing record. Otherwise, insert a new record.
1046
- -- name: UpsertMintAnchorUniCommitment :one
1047
1047
WITH target_batch AS (
1048
1048
-- This CTE is used to fetch the ID of a batch, based on the serialized
1049
1049
-- internal key associated with the batch.
@@ -1052,26 +1052,27 @@ WITH target_batch AS (
1052
1052
WHERE keys .raw_key = @batch_key
1053
1053
)
1054
1054
INSERT INTO mint_anchor_uni_commitments (
1055
- batch_id, tx_output_index, taproot_internal_key_id, group_key
1055
+ batch_id, tx_output_index, taproot_internal_key_id, group_key, spent_by
1056
1056
)
1057
1057
VALUES (
1058
- (SELECT batch_id FROM target_batch), @tx_output_index,
1059
- @taproot_internal_key_id, @group_key
1058
+ (SELECT batch_id FROM target_batch), @tx_output_index,
1059
+ @taproot_internal_key_id, @group_key, sqlc . narg ( ' spent_by ' )
1060
1060
)
1061
1061
ON CONFLICT(batch_id, tx_output_index) DO UPDATE SET
1062
1062
-- The following fields are updated if a conflict occurs.
1063
1063
taproot_internal_key_id = EXCLUDED .taproot_internal_key_id ,
1064
1064
group_key = EXCLUDED .group_key
1065
1065
RETURNING id;
1066
1066
1067
+ -- name: FetchMintAnchorUniCommitment :many
1067
1068
-- Fetch records from the mint_anchor_uni_commitments table with optional
1068
1069
-- filtering.
1069
- -- name: FetchMintAnchorUniCommitment :many
1070
1070
SELECT
1071
1071
mint_anchor_uni_commitments .id ,
1072
1072
mint_anchor_uni_commitments .batch_id ,
1073
1073
mint_anchor_uni_commitments .tx_output_index ,
1074
1074
mint_anchor_uni_commitments .group_key ,
1075
+ mint_anchor_uni_commitments .spent_by ,
1075
1076
batch_internal_keys .raw_key AS batch_key,
1076
1077
mint_anchor_uni_commitments .taproot_internal_key_id ,
1077
1078
sqlc .embed (taproot_internal_keys)
0 commit comments