Re: [gnome-db] gda_data_model_update_row syntax



> looks good, although I would improve it in a way that there is a status
> on the row. That is, we can have a 'updatable' field on GdaRow, and when
> you call get_upodatable_row, that flag is set to TRUE (being FALSE in
> all other cases). Thus, providers can mark the rows that can be updated.
> 
> Also, I dont think we need the get_uopdatable_value function, since the
> updatable values will be the ones contained in the updatable rows
> returned by get_updatable_row.
> 
> cheers

If we have only one get_value() for both type of GdaRow*, what should
the return type be?  Returning 'GdaValue*' will create a burden
(either on us or the users) of remembering which GdaValue* instances
are updatable and which are not.  Returning 'const GdaValue*' will
force the users to cast off "const" from updatable instance--not a
good API.  I want to avoid having yet function for users to remember.
But lacking operator overloading, I don't see how to avoid it.

I also don't see who the intended user of the new 'updatable' field
is.  My rationale is,

  - The users don't need it.  They know 'Gda[Row|Value] *' are
    updatable, and the const ones are not.  

  - The library don't need it.  gda_value_set_int() and friends take
    only 'const GdaValue*', which prevent users from unknowingly
    setting non-updatable instances.  If the user cast off 'const',
    s/he intentionally want to screw up.  There's little point for the
    library to check 'updatable' field and stopping it.

Maybe I missed something?  

Comments are good things :-),

Paisa



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