In addition to this, where a BLOB represents something that could often be a 
file on a disk, methods used to identify the types of those files could often 
be 
used.  For example, with many binary file types the first few bytes of the file 
are signatures for its type, eg with JPEG files for example.  This can't be 
counted on for all BLOBs, but can work for some.  Meta-data is good to have. -- 
Darren Duncan

On 2015-05-09 3:20 AM, Richard Hipp wrote:
> On 5/9/15, 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?
>
> As far as SQLite is concerned, a BLOB is just bytes.  The
> interpretation of those bytes (as floats, doubles, a JPEG thumbnail, a
> file compressed with zlib, etc.) is entirely up to the application -
> SQLite does not know or care.
>
>>
>> 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?
>>
>
> I suppose that depends on the application.  If the field always holds
> exactly the same thing (ex: a JPEG) then the metadata is not really
> needed.  On the other hand, I have added a separate "mimetype" column
> to accompany BLOB fields in cases where the BLOB might be different
> things.
>

Reply via email to