Skip to main content

Module seed

Module seed 

Source
Expand description

Seeds a catalog of DCS/PLC templates into dcs_templates on startup, so a fresh database always has the built-in presets available without a separate “first run” wizard step, and so a future user-supplied catalog file can be kept in sync the same way.

This is an upsert, not a plain insert, because a template’s suffix/unit conventions can be corrected in a later catalog revision, and an existing install’s dcs_templates table should pick up that fix on the next seed rather than being frozen at whatever was current when the row was first created.

Structs§

SeedResult
One template’s seeding result, returned so a caller (cli-commands, the web GUI’s startup routine) can log what happened — bhtune-db itself has no logging dependency.

Enums§

SeedOutcome
What seed_templates did with one catalog template.

Functions§

seed_builtin_templates
Upserts every bhtune_core::built_in_templates entry into dcs_templates with TemplateOrigin::Builtin. A thin, ergonomic wrapper around seed_templates for the common startup case — see its docs for the upsert semantics.
seed_templates
Upserts every template in templates into dcs_templates, all attributed to origin.