Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [stellation-res] Yet another DB abstraction idea...

On Wed, Aug 14, 2002 at 10:36:48AM -0300, Rodolfo M. Raya wrote:
> 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

-10

It is overly verbose.

florin

-- 

"If it's not broken, let's fix it till it is."

41A9 2BDE 8E11 F1C5 87A6  03EE 34B3 E075 3B90 DFE4

Attachment: pgpHTW7GRPQNF.pgp
Description: PGP signature


Back to the top