Re: [gnome-db] gda_data_model_update_row syntax



On Fri, 2003-10-17 at 02:28, Paisa Seeluangsawat wrote:
> > > We may want to add a 'GDA_CONNECTION_FEATURE_UPDATABLE_CURSOR' to the 
> > > GdaConnectionFeature enum to allow the user to check for this before 
> > > attempting to perform the update.
> > > 
> > I've just added this to HEAD. So, now we need to have providers use
> > cursors, where possible, to read recordsets, instead of using a simple
> > "SELECT ..." command.
> 
> I take back my words on 'GDA_CONNECTION_FEATURE_UPDATABLE_CURSOR'.  It
> seems useful now :-).  I also agree that updatable cursor is a good
> thing to use--if available.
> 
> Anyway, I can't find updatable cursor in mysql C api, and postgre
> doesn't seem to support it either [1].  I'm new at this so please
> correct me if I'm wrong.
> 
> Despite that, I think we can still implement update_row() by
> generating a SQL command like,
> 
>   'update ... where column1=old_value1, column2=old_value2... limit 1'
> 
yes, in fact, that was my idea. The provider should know when it can
identify as a unique row.

> which works in most cases where updatable_cursor is normally allowed
> (i.e. select from only one table, no aggregates, etc.,.).  It works
> even in the case that our 'where ...' matches more than one record
> [2].
> 
> The design I sent to the list on 14 Oct [3] can accommodate both
> updatable cursor and update command implementations, and I'd love to
> see it implemented.  Though if someone could improve it or propose a
> better design, that would also be great :-).
> 
well, the updatable models implementation is totally left to the
provider. It should be hidden to clients, and each provider would use
whatever best is for it to do the job. Clients would just use
gda_data_model_*.

In fact, I guess I'll change the GDA_CONNECTION_FEATURE_UPDATABLE_CURSOR
to be either _UPDATABLE_MODELS, or just remove it, since we already have
the gda_data_model_is_editable, to find out if a given data model can be
edited or not.

cheers




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