Re: [gnome-db] GnomeDbForm
- From: Paisa Seeluangsawat <paisa unt edu>
- To: Laurent Sansonetti <laurent datarescue be>
- Cc: Rodrigo Moya <rodrigo gnome-db org>, Paisa Seeluangsawat <paisa unt edu>, GDA <gnome-db-list gnome org>
- Subject: Re: [gnome-db] GnomeDbForm
- Date: Thu, 30 Oct 2003 23:11:32 -0600
> I would prefer to have a single method/operator, like this:
>
> val.value = 'foo'
> val.value = 123
> # etc...
>
> Which is a better interface I think.
That actually does look better it make me want to learn Ruby :-).
Murray, please don't let my beloved C++ lag behind :-).
One thing to keep in mind though, is what will GdaType of the new
value be?
- We can't rely on the old GdaType since it could be TYPE_NULL.
- If we just deduce GdaType from the rvalue, the new type might not
match the type of that column. This could cause problems when the
user's code (reasonably) assumes that GdaValue's in the same
column are of the same type or TYPE_NULL.
Which makes me wonder, why does libgda has NULL as a type and not as a
value? All I found was,
http://mail.gnome.org/archives/gnome-db-list/2003-April/msg00069.html
> We decided long ago that it was better to have a separate type for
> NULL values, to avoid the need to have different cases for each
> type's real NULL value (for instance, how to specify a NULL in an
> integer?)
However, it's pretty simple to add a member 'bool is_null' into
GdaValue. Memory probably isn't the issue since the size of GdaValue
is already 48. Alternatively, if we make is_bull a bit set on
GdaType, the size of GdaValue wouldn't change at all. Speed probably
isn't the issue either. There are other much bigger overheads in
using SQL and/or libgda.
I tried to search ChangeLog and the mailing list but couldn't find
when this was decided. What was the rational back then?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]