[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Erw-devel] Adding abstract datatypes

From: erw-devel
Subject: [Erw-devel] Adding abstract datatypes
Date: Mon, 14 Feb 2005 20:16:05 -0500 (EST)

Congrats on the htmlarea - thats a good functionality to add and it looks

I'm curious - is there any intention to abstract out the SQL datatyps so
you can create your own domain based types and then map those to the
database you are using?

For example :

<enum id="invstat" type="int">
        Status values for invoices, indicating their current disposition.
        <enumval value="1"  label="Invoice Unsent"/>
        <enumval value="2"  label="Invoice Sent"/>

Rather than type="int", lets say I want only 0 and positive numbers
(naturals). I use $TARGET to say 'the name of what i create goes here'.

<!DOCTYPE erl PUBLIC "-//DSI//DTD ERL V1.2//EN" "file://erl-types.dtd">
<type id="natural">
   <create>$TARGET integer check ($TARGET > 0)</create>

Obviously there are some tricks, since the above could also (to some
people preferably) be done as follows:

create table foo {
bar integer,
          CHECK ($TARGET > 0)

so the syntax above would ideally support inline (first version) and
named/after table definition versions.

Is it possible? Hard? Likely? :)

Alfred Werner

reply via email to

[Prev in Thread] Current Thread [Next in Thread]