On 7/1/07, Mov GP 0 <[EMAIL PROTECTED]> wrote:
I'm searching for a database backend for a .NET project that involves a
semantic database backend. The problem is that I want to store any generic
kind of custom .NET datatype and not only SQL-primitives.
CREATE TABLE @TableName
(
Object INT,
Data @Datatype
)
The @Datatype Parameter is a special object that implements something like a
"ISQLiteDatatype" Interface that provides information about the class that
is needed for getting information about the used datatype. This includes:
- how to serialize (use also ISerializeable)
- how to sort (use also ICompareable)
- is it possible to do byte ordering with the serialized data?
- minimal and maximal Datasize and -lenght?
- etc.
SQL is not capable to handle this issue, but I think it should be possible
using the API. At least in MS SQL Server it is possible, but you can't
create new datatypes on the fly, but you have to upload and register the
datatype's class to the server as DLL.
I'm not sure I understand what you're looking for here. The SQL
interface (for any DBMS) is not going to act like a .NET object; that
behavior is contained within your application. What exactly are you
trying to gain with custom data types within the DB? Are you trying
to standardize an interface for other applications to use when talking
to the same DB?
SQLite might be better suited for this issue, because as part of the
application it can access the sorting and serialisation functions directly
rather than importing DLLs. But the question is how I can do that.
SQLite is an embedded database engine, so when you need to make
customizations like this, nobody other than your application is going
to be using the DB. Since you're not modifying fundamental DBMS
functionality, you don't need to do anything to SQLite; just build a
wrapper in your application that uses BLOBs to store everything, and
build the rest of your application on top of that wrapper.
The same approach will work with pretty much any other DBMS as well.
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------