Re: [gnome-db] Changing a field definition



On Wed, 2004-05-05 at 11:20 +0000, Murray Cumming wrote:

> > >  
> > > > > add_field_to_table()
> > > > > delete_field_from_table()
> > > > > modify_field()
> > > > >
> > > > hmm, I'd like to have a more 'elegant' way of doing it, like doing it
> > > > via the data model (both the one returned by get_schema like any
> > > > others). This involves more work on the providers, but I think it makes
> > > > more sense, given we already have the update_column API in the data
> > > > model.
> > > 
> > > Note that we already have vfuncs for update_column(), append_column(),
> > > and remove_column() on the DataModel, but there are no implementations.
> > > 
> > yes, right. Do you mean we could not use it then, given we have no implementations? 
> > What other mechanism can we use?
> 
> No, I don't think they are useful, because they are methods on the
> datamodel, and I shouldn't have to get some data just to change the data
> structure. I was just pointing it out - you might want to remove them or
> deprecate them.
> 
> I'm still in favour of explicit methods like
> gda_connection_change_field_definition(tablename, GdaFieldAttributes).
> 
> I'm not sure how well this can actually work because
> - I don't know how well the GdaValueTypes map to underlying database
> types.
>
the providers should map them correctly.

> - Changing a field definition will often be slow and lossy, and is
> sometimes very difficult - postgres needs us to create a new column,
> copy the data across, delete the original, and rename.
> 
I would prefer something that allows changing several fields at once.
So, for instance, the modify_table method you mentioned, containing, as
parameters, a list of the fields to be changed. How does that sound?

cheers




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