
Return the `traitlist` lookup table, cached per session
get_traitlist.Rd`traitlist` is a small lookup table (~50 rows) that the package re-fetches from the database in many places to find the `valuetype` of a trait or to join trait definitions to measurements. Re-fetching ~50 rows on every call adds up to thousands of round trips during a typical workflow, even though the table changes very rarely (only when [add_trait_taxa()] inserts a new row).
Details
`get_traitlist()` fetches the table once into an internal cache (`.db_env$traitlist_cache`) and returns the cached `data.frame` on subsequent calls. The cache is invalidated automatically when a new trait is added via [add_trait_taxa()] and when [cleanup_connections()] is called. Use `refresh = TRUE` to force a re-fetch (e.g. after an external update).