[geeklog-devel] UDFs

Dwight Trumbower dwight at trumbower.com
Mon Mar 3 12:16:17 EST 2003

At 10:26 AM 3/3/2003 -0600, Tony wrote:
> >
> > Create Table udfs(
> >          udfid
> >          name  - field name on ui
> >          datatype  - could have a lookup table but might need to
> > denormalize for performance
> >          scope - Where it is used, could be global, screen name, form 
> name,
> > etc.
> >          udfvalue - stored data for the udf
>Where is min/max value fields?

Are there any other type of special fields that would need to be handled? 
Maybe radio buttons and how are they grouped? Or is this getting to low level?

>Also i'd consider two value fields:
>    udf_shortvalue varchar(255);
>    udf_longvalue text;
>We may want to move long values to separate table to speed up table scans:
>     create table udflongvals
>         udfid - FK and PK
>         udflongvalue text

I've never liked storing a short and long value in a table, too redundant 
for me. But I see the benefit of having a separate table for text data 
types. Outer join would pick them up nicely for reads. When saving data, 
the program code will look at the data type field and save to the longvals 
table if the data type is text. When doing searches, you just issue two sql 
statements, one for the main table and another for long values.

> >
> > You could store the potential values in another table if you wanted to
> > dynamically create a list.
> >   i.e. attributes for a SELECT element
> >
> > Create table udfattributes
> >          udfid  - links to the udf table
> >          name - attribute name, used in list
>Definitely need this  I think you'll need a value field so that data like:
>udfid: 1
>udfvalue: 1
>udfname: $_LANG['plaintext']
>would give you:
><option value="1">Plain Text</a>

We should probably add a default attribute too.

>Also, do we care about sorting the order of items?

Probably yes

>Would we use the same table for radio button edits?

Wouldn't they be in the main table? I have a question about radio button above.

dwight at trumbower.com

More information about the geeklog-devel mailing list