DEV Community

Discussion on: What's your favorite way to manage system-wide settings? (except .env)

Collapse
 
dmfay profile image
Dian Fay

You could set up your table like this:

key value_str value_int value_bool ...
one a string null null

and use check constraints to ensure that only one value column is ever filled (as long as you're not using MySQL which doesn't actually implement them). But that's still probably overkill if you don't have to retrieve values that frequently. Simple kludges are the best kludges.