importutil

package
v0.47.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package importutil provides shared helpers for metadata import operations across all database backends (sqlite, postgres, mysql).

Index

Constants

View Source
const RefetchChunkSize = 500

RefetchChunkSize limits the number of tx_ids in a single WHERE IN clause to stay within database variable limits (e.g. SQLite's SQLITE_MAX_VARIABLE_NUMBER, PostgreSQL's 65535 parameter limit).

Variables

This section is empty.

Functions

func BatchHydrateUtxoProvenance added in v0.47.1

func BatchHydrateUtxoProvenance(
	db *gorm.DB,
	utxos []models.Utxo,
	chunkSize int,
) error

BatchHydrateUtxoProvenance attaches transaction provenance to UTxOs that were inserted earlier from a ledger-state snapshot. The chain backfill later replays the producing transaction with the same tx_id/output_idx pair, but the bulk import uses ON CONFLICT DO NOTHING, so conflicted rows need this second pass to gain their transaction foreign key and real added slot.

func BatchRefetchUtxoIDs

func BatchRefetchUtxoIDs(
	db *gorm.DB,
	utxos []models.Utxo,
) error

BatchRefetchUtxoIDs resolves IDs for UTxOs whose ID was not populated by GORM after an ON CONFLICT DO NOTHING insert. It replaces per-UTxO SELECT queries with chunked batch lookups.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL