[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [stellation-res] Yet another DB abstraction idea...
|
On Wed, 2002-08-14 at 05:55, Mark C. Chu-Carroll wrote:
The template version would be:
String command =
db.expandCommand("CREATE TABLE Properties " +
"($INT aid, $INT vid, $INT inheritable, $SHORTSTRING name" +
"$LONGSTRING value, " +
"CONSTRAINT fk4 FOREIGN KEY (aid, vid) REFERENCES Versions(aid,vid), " +
"PRIMARY KEY(aid, vid, name))$CREATE_TRAILER");
DB implementations would provide a set of mappings of keywords to
the appropriate value for the database.
It looks like SQL, it's easy to write, and it'll be easy to implement. Seems
like an obvious answer, much less stupid than the earlier idea. What do
you all think?
Hi,
Looks a lot better than before. However, I like more the XML approach that Mariano Kamp mentioned before.
Do you find the following pseudo-XML difficult to read?
<create_table name="Properties">
<field>
<field_name>aid</field_name>
<field_type>INTEGER</field_type>
</field>
<field>
<field_name>vid</field_name>
<field_type>INTEGER</field_type>
</field>
<field>
<field_name>inheritable</field_name>
<field_type>INTEGER</field_type>
</field>
<field>
<field_name>name</field_name>
<field_type>VARCHAR<field_length>200</field_length> </field_type>
</field>
<field>
<field_name>value</field_name>
<field_type>VARCHAR<field_length>1600</field_length> </field_type>
</field>
<key type="PRIMARY">
<fields>
<field_name>aid</field_name>
<field_name>vid</field_name>
</fields>
</key>
<key type="FOREIGN">
<key_name>fk3</key_name>
<references.
<table_name>versions</table_name>
<fields>
<field_name>aid</field_name>
<field_name>vid</field_name>
</fields>
</references>
</key>
</create_table>
A document like this could be easily translated to fit the syntax of any DBMS via a style sheet.
Rodolfo
--
MAXPROGRAMS
IBM Business Partner
Microsoft MSDN Business Connection Partner
rmraya@xxxxxxxxxxxxxxx
http://www.maxprograms.com
|