Skip to contents

Recalculates aggregated statistics in artist_stats table. Call this after adding or removing artworks to keep counts accurate.

Computes: total_brushes, total_hours, total_artworks, total_collections, ave_bpm, ave_brushes, ave_hours.

Usage

update_artist_stats(artist, cn = NULL)

Arguments

artist

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

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.

Value

NULL invisibly. Updates database as side effect.