Re: [gnome-db] gda_data_model_update_row syntax



On Mon, 2003-10-13 at 06: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*.
> 
yes, the reason to use const there was to clearly state that the
returned value shouldn't be freed. But yes, you are right that it gives
problems now for the get_row/update stuff.

Any suggestions?

>   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.
> 
hmm, again, the reason for these functions to be public is so that
providers can use them. Maybe we should provide them in a different
header for providers?

cheers




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