database tables for VuXML

Jacques A. Vidrine nectar at FreeBSD.org
Fri Aug 27 07:04:26 PDT 2004


On Thu, Aug 26, 2004 at 06:59:05PM -0400, Dan Langille wrote:
> I am now finalizing my tables.  I have some comments below and some
> questions about your tables.
[...]
> I'm not going to have a last column.  And I am using TEXT, not DATE,
> as the values are not always dates.  I recall reading someone
> suggesting allowing unknown.  If the date is unknown, I suggest
> leaving this field empty.

Actually, with SQLite, all columns are really strings even if one
specifies other SQL types :-)

Oliver requested that `unknown' be a valid value.  The only other
valid format is YYYY-MM-DD.

> If the suggestion above is accepted, I will reconsider my DATE versus
> TEXT decision as I could then use a NULL value.

Yes, you should expect that `unknown' <discovery> dates are generated
by Oliver or his perl script.  They should all be transient values:
even though such entries will technically be acceptable, they are
morally bugs. :-)

> > >
> > >         CREATE TABLE refs (
> > >              vid           VARCHAR
> > >            , type          VARCHAR
> > >            , text          VARCHAR
> > >            );
>
> What is this type?  I fear I have asked this already.  I have added
> the table but without the type field.

This is a different type than the other :-) References are (type,
text) tuples, where the type can be "url", "cvename", "uscertta",
"mlist", and so forth.  The meaning of the text of course depends
upon the type.  The list of types is constrained by the VuXML DTD,
but VuXML processing tools should handle any unrecognized type
generically.

> > >         CREATE TABLE affected (
> > >               vid          VARCHAR
> > >            ,  type         VARCHAR
> > >            );
> >
> > What is this type field?  I didn't follow what the affected table
> > contains.
>
> Ahh, type is either package or system.
>
> e.g.
>
>       <package>
>         <name>tnftpd</name>
>         <range><lt>20040810</lt></range>
>       </package>
>       <package>
>         <name>lukemftpd</name>
>         <range><ge>0</ge></range>
>       </package>
>       <system>
>         <name>FreeBSD</name>
>         <range><ge>4.7</ge></range>
>       </system>

Yes, the type column in *this* table is "package" or "system".

> > >         CREATE TABLE names (
> > >               affected     INTEGER
> > >            ,  name         VARCHAR
> > >            );
>
> This I now understand. It's a list of the affected packages, or
> systems.  For packages, it appears to be PORTNAME.  Is that true?

Almost.  In FreeBSD ports collection terms, the <name> element contains
the PKGNAME minus the version, i.e.
${PKGNAMEPREFIX}${PORTNAME}${PKGNAMESUFFIX}.

> I see now why you have names and affect separate:
>
>       <package>
>         <name>gaim</name>
>         <name>ja-gaim</name>
>         <range><lt>0.81_1</lt></range>
>       </package>
>
> A given package may have more than one name (e.g. slave ports).

Right.  Another example is compile time options, e.g. "vim", "vim-lite".

[...]
> Each package has a list of 1 or more ranges which are affected.  The
> ranges affect all names listed in the package.
>
> e.g.:
>
>       <package>
>         <name>samba</name>
>         <range><ge>3</ge><lt>3.0.5,1</lt></range>
>         <range><lt>2.2.10</lt></range>
>       </package>

You got it.

> Thanks.  This is coming together and I'm getting closer to having
> tables.

Cheers,
-- 
Jacques Vidrine / nectar at celabo.org / jvidrine at verio.net / nectar at freebsd.org


More information about the freebsd-vuxml mailing list