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§
- Seed
Result - One template’s seeding result, returned so a caller (
cli-commands, the web GUI’s startup routine) can log what happened —bhtune-dbitself has no logging dependency.
Enums§
- Seed
Outcome - What
seed_templatesdid with one catalog template.
Functions§
- seed_
builtin_ templates - Upserts every
bhtune_core::built_in_templatesentry intodcs_templateswithTemplateOrigin::Builtin. A thin, ergonomic wrapper aroundseed_templatesfor the common startup case — see its docs for the upsert semantics. - seed_
templates - Upserts every template in
templatesintodcs_templates, all attributed toorigin.