Menu

#14 Drive resource mappings from config instead of DB meta data

open
nobody
None
5
2006-11-06
2006-11-06
No

Right now it appears that SQLREST derives the
resource definitions based on the TABLE structure of
the database. Often a database may contain
information about a single object in mutiple tables.
I would be nice to be able to manually control the
structure of the resources based on a configuration
file such as the following:

<operations>
<operation name="put"></operation>
<operation name="get">
<parameters>
<parameter name="id" />
</parameters>
<map>
<sql>
select col1, col2, col2 from table where
uid='{id}'
</sql>
<mapping>
<map column="col1" to="xpath" />
<map column="col2" to="xpath" />
<map column="col3" to="xpath" />
</mapping>
</map>
</operation>
</operations>

I am by no means a REST expert, so what is above may
not make sense, but I think by controlling the
structure of the resources the designer would have
better control and be better able to handle database
schema evolution.

One could argue that you could do much of the same
using read/write views I suppose and perhaps that
would be a better mechanism.

Discussion


Log in to post a comment.