Skip to contents

Creates a complete artwork record across all related tables in a single transaction. This is the primary entry point for artwork ingestion from the processing pipeline.

All inserts happen atomically - if any fails, the entire transaction rolls back, leaving the database in a consistent state. This prevents orphan records.

Typically called by artpipelines::processArtwork() after all data tables have been prepared.

Usage

add_artwork(
  artist,
  artwork,
  artwork_colors,
  artwork_frame_analytics,
  artwork_hash,
  artwork_index,
  artwork_meta,
  artwork_paths,
  artwork_profiles,
  artwork_stats,
  artwork_styles,
  global_styles,
  cn = NULL,
  artwork_opensea = NULL
)

Arguments

artist

Character. Artist UUID (format: "746bxxxx-xxxx-xxxx-xxxxxxxxxxxx"). Validated with artcore::validate_uuid() where applicable.

artwork

Character. Artwork UUID (format: "99xxxxxx-xxxx-xxxx-xxxxxxxxxxxx"). Validated with artcore::validate_uuid() where applicable.

artwork_colors

data.table for artwork_colors table (per-frame color data)

artwork_frame_analytics

data.table for artwork_frame_analytics table

artwork_hash

data.table for artwork_hash table (image fingerprints)

artwork_index

data.table for artwork_index table (core record)

artwork_meta

data.table for artwork_meta table (image dimensions)

artwork_paths

data.table for artwork_paths table (CDN locations)

artwork_profiles

data.table for artwork_profiles table (AI descriptions)

artwork_stats

data.table for artwork_stats table (performance metrics)

artwork_styles

data.table for artwork_styles table (style tags)

global_styles

data.table for global_styles table (platform-wide tags)

cn

Database connection. If NULL, creates a connection via artcore::dbc() and closes it on exit. Pass an existing connection to batch multiple queries efficiently.

artwork_opensea

Optional data.table for NFT listing info

Value

TRUE invisibly on success. Errors on failure (transaction rolled back).