My design philosophy is that if I have to think about what something is, 
then that thought is a piece of information that should accompany the 
blob.  Consider ten years from now when someone else is looking at the 
database for the first time. Will they know what is in that blob? Column 
names should be descriptive of its contents. If you cannot describe the 
contents in a word, then that row should have at least a simple text 
column so a description can tag the blob.

------------
Scott Doctor
scott at scottdoctor.com

On 5/9/2015 4:18 AM, William Drago wrote:
> On 5/9/2015 6:40 AM, Eduardo Morras wrote:
>> On Sat, 09 May 2015 06:09:41 -0400
>> William Drago <wdrago at suffolk.lib.ny.us> wrote:
>>
>>> All,
>>>
>>> Say you encounter a blob in a database. There's no way to
>>> tell if that blob carries bytes, floats, doubles, etc, correct?
>>>
>>> Assuming the above is true, then is it always prudent to
>>> store some metadata along with your blobs so that they can
>>> be identified in the future?
>>>
>>> Example table:
>>>
>>> ModelNo TEXT (e.g. SO-239)
>>> SerialNo TEXT (e.g. 101)
>>> VSWR BLOB (e.g. x'feab12c...')
>>> VSWR_Type TEXT (e.g. double)
>>>
>>>
>>> Does this make sense?
>> You can use SQL comments on CREATE TABLE, those comments aren't 
>> deleted from SQLITE_MASTER table, you can query it as a normal table.
>>
>> CREATE TABLE blob_table (
>>   ModelNo TEXT,  -- e.g. S0-239
>>   SerialNo TEXT, -- e.g. 101
>>   VSWR BLOB      -- double, e.g. x'feab12c....'
>> );
>>
>> SELECT sql from sqlite_master where type='table' AND 
>> tbl_name='blob_table';
>>
>> will return
>>
>> CREATE TABLE blob_table (
>>   ModelNo TEXT,  -- e.g. S0-239
>>   SerialNo TEXT, -- e.g. 101
>>   VSWR BLOB      -- double, e.g. x'feab12c....'
>> )
>
> This is a clever idea and saves the addition of a column just for blob 
> type. Is this a reliable feature of SQLite? Does anyone see any issues 
> with this as opposed to using a dedicated column?
>
> Thanks,
> -Bill
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>

Reply via email to