On Dec 29, 2008, at 10:22 AM, Roland Bouman wrote:
Hi All,
On Mon, Dec 29, 2008 at 5:06 PM, Tim Soderstrom
<[email protected]> wrote:
Well, since Drizzle is going to be pluggable, is this something
that can be
a plugin and simply be built from native storage types? Like human-
readable
IPv4 addresses, the underlying storage could just be an integer.
When you
store or call it, you could just automatically run a function to
present it
in a friendly way? That may be already what you are doing with the
TIME
field and I can't claim to be an expert but thought I'd throw that
out there
:)
A related point came up earlier regarding user-definable data types. I
think that if drizzle wants to support it, the storage itself is
probably the least of all problems. IMO the real problem is how to
magically add the capabilities to the existing operators and functions
to make them understand how to work with the new data type.
Take for example the (standard) syntax for adding to dates:
<date-expr> + INTERVAL 4 DAY
Now suppose we have this user-defined TIME type. You are going to want
to reuse this syntax. So, somehow, the existing " + INTERVAL "
operator needs to learn how to deal with this new left hand
operand.One way of solving it would be to have the user defining the
data type also add a collection of implementations to overload
existing functions to work with operands of this new type.
I am not saying that is the solution, just pointing out that this
seems like a non-trivial architectural matter that should probably be
thought out sooner rather than later if this is going to be supported.
I'd love to see something like this personally. It could be used for
evil (very much so) but I think it could also be amazingly useful.
None need look further than the IPv4 issue in MySQL. PostgreSQL might
be an extreme case, but it has IPv4 (and 6, if I'm not mistaken), MAC
addresses and all sorts of fun stuff. Yes, I know "then why don't you
use PostgreSQL", but that's not the point of this discussion :) The
point is that MySQL has some primitive types (and a few weird squirley
ones) but extending these out seems to be precariously difficult. It
shouldn't be so.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp