I'm not sure I understand why you can't specify the type in a separate
column, rather than prepending it to the blob? That seems like a more
flexible way to have access to the information.

Regards, Ketil
On 17 Apr 2016 2:02 p.m., "William Drago" <wdrago at verizon.net> wrote:

> All,
>
> Any thoughts on using the first byte of a BLOB to indicate what kind of
> data that BLOB contains?
>
> For example:
> 0 = plain old bytes
> 1 = 16 bit integers
> 2 = 32 bit integers
> 3 = singles
> 4 = doubles, etc.
>
> I am forced to consider this approach because my function will be
> receiving blobs but will have no idea what those blobs are. However, I can
> ask the sender to prepend the blob with an indicator byte to provide the
> necessary information.
>
> In the past I have used comments in the table structure and even used
> custom types (e.g. i16BLOB, for a blob that contains 16 bit ints), but in
> this case I will not have access to that information. The data is coming to
> me in the form of an ADO.NET DataTable which does not contain such
> information.
>
> Of course tagging the blobs like this will increase the size of the
> database, but not by much, and if this "feature" is not clearly documented
> someone in the future will have a very hard time figuring out why the blobs
> don't make sense.
>
> Is there anything else I should be aware of?
>
> 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