Re: [gnome-db] Minor API change and MySQL [update/delete]_row



Thanks Rodrigo for pointing out my CVS and C formatting and
portability issues.  I've corrected them, but will need experienced
eyes to keep me in check.


> > +// FIXME: These hopefully will go into *_impl.h ================
> > +
> why?

These functions are used only by providers.  Separating these from
functions that end users use can help cut libgda learning curve,
reduce the chance users mess up the system, and tidy up the
documentation.


> > -			gda_value_set_from_value (gda_row_get_value (row, i), value);
> > +			gda_value_set_from_value (gda_row_get_updatable_value (row, i), value);
> >
> hmm, this looks wrong to me. Why do we want a
> gda_row_get_updatable_value? What, apart from not returning const
> will it do?

Returning const and non-const is the only difference.  Now, how does
this look wrong?


> > +	g_string_sprintf (str, "DELETE from %s WHERE %s", recset->table_name, id);
> > +
> this looks wrong, isn't it missing the correct WHERE clause?

id contains something like " key_column='foo' ".


> > +	... after a successful DELETE command ...
> > +	
> > +	// FIXME what to do with the record now?
> >
> of course, remove it from the model :-) and notify clients of the
> change, via the gda_data_model_row_removed function.

What the question meant was, whether to,

   1) leave that row in data model blank and return NULL on _get_row().
   2) shift rows up -- this might cause some complications.

I was going to go for 1), but think I should ask the list first.




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