Re: [gnome-db] gda_data_model_update_row syntax



On Mon, 2003-10-13 at 08:06, Ian D. Stewart wrote:
> On Monday 13 October 2003 00:01, Paisa Seeluangsawat wrote:
> > Three e-mails in a row :-),
> >
> > I was going to implement [remove/update]_row for mysql.  But I'm not
> > even sure how the user is supposed to use it.  My guess is,
> >
> >      GdaRow *row = gda_data_model_get_row (model, row_number);
> >      ... manipulate row data somehow ...
> >      gda_data_model_update_row (model, row);
> >
> > There are many problems with this,
> >
> >   1) gda_data_model_get_row() return const GdaRow*.  It looks very much
> >      like *row isn't to be edited.
> >
> >   2) Even after casting const off row*, gda_row_get_value() also
> >      return const GdaValue*.
> >
> >   3) Granted that the user edited *row somehow, how am I going to know
> >      which record *row was from?  Both gda_row_set_numer() and
> >      gda_row_set_id() are public functions.  So, I can't rely that the
> >      user wouldn't use it.
> >
> 
> Something else to keep in mind is that the ability to update a row (as opposed 
> to executing an update SQL statement) is dependant on support for updatable 
> cursors within the target database.
> 
right

> 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.

Laurent, since you were looking for some task to do, what about making
the postgres provider (or any other) use cursors for reading the
recordsets? If you want to work on that, it's all yours.

cheers





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