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



On Tue, 2003-10-28 at 07:45, Paisa Seeluangsawat wrote:
> 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.
> 
no problem :-)

> 
> > > +// 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.
> 
well, they are used by anything that might change a data model, so they
have to stay in the main .h file.

> 
> > > -			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?
> 
well, the thing is that I am not clear on whether using that separation
is ok. As I said, we should remove all const in the arguments list for
the objects (as any other GNOME lib does).

I'm not really sure what's best, what others think?

> 
> > > +	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' ".
> 
ok

> 
> > > +	... 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().
>
that seems a bad thing to do...

>    2) shift rows up -- this might cause some complications.
> 
well, the model will have to return the number of rows/columns it's got,
so that has to be the reality. So I guess yes, we should just remove the
row and notify, via gda_data_model_row_removed, the listeners.

> I was going to go for 1), but think I should ask the list first.
> 
I think 1 is wrong, since if you pass the model to a different part of
code, that knows nothing about the removed row, it will get an incorrect
number of rows from the data model.

cheers




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