Skip to contents

Creates a new collection for an artist with default settings. Collections are containers for grouping related artworks (series, projects, etc.).

This function creates records in both collection_index and collection_settings tables atomically. The settings row ensures visibility queries work correctly for new collections.

Usage

add_collection(artist, collection_name, cn = NULL, is_test = FALSE)

Arguments

artist

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

collection_name

Character. Display name for the collection.

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.

is_test

Logical. If TRUE, generates a test UUID (for testing only).

Value

Collection UUID (character) on success. Use this UUID for subsequent artwork assignments.