Re: Table design for application options

From: Neo <neo55592_at_hotmail.com>
Date: 15 Dec 2004 07:24:23 -0800
Message-ID: <1103124263.332930.85650_at_c13g2000cwb.googlegroups.com>


> If I have an application that has a handful of configuration options
> what is a good way to store these options in a table? e.g.
> feature_x_enabled boolean
> default_currency_symbol character
> default_currency_name string

Of your two options, a table with two columns typed as string seems more flexible. Below is an alternative method with an experimental db:

CREATE *feature.item ~in = dir;

CREATE *currency.item ~in = dir;
CREATE *dollar.cls = currency;
CREATE dollar.symbol = '$';

CREATE *app.item ~in = dir;

CREATE app.feature = +feature1;
CREATE app.feature = +feature3;
CREATE app.currency = dollar;

// Find if app has feature3
// Finds app has feature3
SELECT app.feature = feature3;

// Find the app's currency symbol
// Finds $
SELECT (app.currency=%).symbol = %; Received on Wed Dec 15 2004 - 16:24:23 CET

Original text of this message