All good suggestions, folks. To summarize:

Dr. Hipp uses an additional column.
Eduardo Morras recommends comments.
Simon Slavin recommends comments or in some cases a table dedicated to metadata.
Darren Duncan confirms the need for metadata.
Scott Doctor recommends putting the info in the column name.
Eric Hill suggests taking advantage of SQLite's type flexibility and adding the 
info to the column type.

I liked the idea of using comments, but while they are great for human 
consumption, they are not easy to read programmatically. Since I want to build 
VEE* structs automatically from SQLite tables this is important.

Correct me if I'm wrong, but the only way to read comments is by reading back 
the entire CREATE TABLE string, correct?

* http://en.wikipedia.org/wiki/Agilent_VEE

Thanks,
--
Bill Drago
Senior Engineer
L3 Narda-MITEQ
435 Moreland Road
Hauppauge, NY 11788
631-272-5947 / William.Drago at L-3COM.com


> -----Original Message-----
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-
> users-bounces at mailinglists.sqlite.org] On Behalf Of Eric Hill
> Sent: Saturday, May 09, 2015 9:55 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Please confirm what I THINK I know about blobs
>
> This approach:
>
> CREATE TABLE blob_table (
>   ModelNo TEXT,
>   SerialNo TEXT,
>   VSWR BLOB_DOUBLE
> )
>
> involves comments?  I don't see how.  Nothing wrong with the comments
> approach, but this is an approach that just takes advantage of the fact
> that SQLite does not have fixed data types.
>
> Eric
>
> From: Simon Slavin<mailto:slavins at bigfraud.org>
> Sent: ?Saturday?, ?May? ?9?, ?2015 ?3?:?52? ?PM
> To: General Discussion of SQLite Database<mailto:sqlite-
> users at mailinglists.sqlite.org>
>
>
> On 9 May 2015, at 8:12pm, Drago, William @ CSG - NARDA-MITEQ
> <William.Drago at L-3com.com> wrote:
>
> > Best idea yet! Anyone see any issues with this?
>
> It's actually a comment, and SQLite provides ways of putting proper
> comments in table definitions:
>
> CREATE TABLE blob_table (
>  ModelNo TEXT, -- new-style models as used from 2006 onwards  SerialNo
> TEXT,  VSWR BLOB -- array of ten double-length floats
> )
>
> These comments can be found if you look at the table definition in
> sqlite_master.
>
> I've also seen SQL databases where the designer created an otherwise
> unused table to hold comments on every column, something like this:
>
> CREATE TABLE _structure (
>  tableName TEXT,
>  columnName TEXT,
>  introduced TEXT,
>  variableType TEXT,
>  theComments TEXT
> )
>
> 'introduced' was the edit of their program which first used the column
> (equivalent to 'checkin' as used by the SQLite development team).
> 'variableType' was not the SQL type but the type of variable in the
> programming language they were using the database with.  This helped
> because the language had numerous variable types and subtle bugs could
> be introduced if you, for example, stored a value from an unsigned
> integer then did maths on the value in a long integer.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any 
attachments are solely for the use of the addressee and may contain information 
that is privileged or confidential. Any disclosure, use or distribution of the 
information contained herein is prohibited. In the event this e-mail contains 
technical data within the definition of the International Traffic in Arms 
Regulations or Export Administration Regulations, it is subject to the export 
control laws of the U.S.Government. The recipient should check this e-mail and 
any attachments for the presence of viruses as L-3 does not accept any 
liability associated with the transmission of this e-mail. If you have received 
this communication in error, please notify the sender by reply e-mail and 
immediately delete this message and any attachments.

Reply via email to