The Rdbs, Interbase, and Firebird have supported a numerical blob type to support automatic blob type conversions via blob filters. It works, but other than for translating system blobs to ascii for display, it hasn't seen much use and hasn't been picked up by other systems. For Netfrastructure, I give it up in favor of the more standard Blob and Clob types. This wasn't completely successful, either, as to index MS Word of PDF documents, Netfrastructure had to probe file headers, etc., to determine the document types.
In Amorphous, I went two steps further. First, the opaque type provides for an optional "out of band" mime type to describe the format of the document. And, following the traditional programmer mindset of "zero, one, infinitely", I added provision for an arbitrary number of user defined attributes. I have no idea of how they will eventually be used, but my guess is they will be useful for tracking a document's provenience -- who created it, when, and what was the phase of the moon.
The API for handling opaques for both input and out is by instances of the interface below, which was motivated by first, eliminating any need to make intermediary copies, and second, to obviate any need to materialize the blob as a continuous object.
class Opaque
{
public:
virtual ~Opaque()
{};
virtual void addRef() = 0;
virtual void release() = 0;
virtual size_t getLength() = 0;
virtual const uint8_t* getSegmentAddress(void*& handle,
size_t& length) = 0;
virtual int getAttributeCount() = 0;
virtual const char* getAttributeName(int index) = 0;
virtual const char* getAttributeValue(const char
*attribute) = 0;
};
I'm not suggesting that Firebird necessary go down this path, but it
might be worth thinking about.
------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://makebettercode.com/inteldaal-eval
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
