Re: [gnome-db] Last insert feature request
- From: Piotr Pokora <piotrek pokora gmail com>
- To: "Daniel Espinosa" <esodan gmail com>
- Cc: gnome-db-list gnome org
- Subject: Re: [gnome-db] Last insert feature request
- Date: Thu, 6 Dec 2007 10:11:12 +0100
"Daniel Espinosa" <esodan gmail com> wrote:
Hi!
> > Wouldn't it be easier and more flexible to retrieve primary column name using
> > provider's reflection? I know that last_insert_id is sometimes helpfull , but in practice
> > this functionality is useless with SQLite ( IIRC ) and may foolish you with MySQL.
> >
> > Personally I would store primary column name as "application's parameter" instead of
> > fetching it with every insert command.
>
> But how do you get the value in the primary key column for the last
> inserted row?
I do not say this API function is bad.
I think returned gchar is not good and GValue as returned data type seems to be the best.
> What do you mean about "provider's reflection"?
I didn't check this in practice, but you could get this infor using provider's schema.
get_schema function with GDA_CONNECTION_SCHEMA_FIELDS identifier.
My point is that GDA *should not* abuse returned data in this particular case.
Returned GdaParameter could be ( IMO ) a bit overloaded. It's up to the application and developer
to get as many information as needed. So if two data are needed ( a name and value ) two functions
should be called instead of one.
Piotras
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]