Re: First impressions/problems (was [gnome-db] libgda and application development )



> > specified, which is usually not needed at all for "normal" uses. The
> > easiest way for executing commands is either by using
> > gda_connection_execute, or by using the GdaCommand class:
> > 
> > cmd = gda_command_new ();
> > gda_command_set_connection (cmd, cnc);
> > gda_command_set_text (cmd, "SELECT * FROM my_table");
> > recset = gda_command_execute (cmd, &reccount, NULL);
> 
> Hrmm okay well.. I guess i can understand why. It does seem like though,
> that it would be nice to have a recordset be able to function without a
> command object, or perhaps an implicit instantiation of one so that developers
> wouldn't have to mess with it.
> 
> ie.
> 
> gda_recordset_sql_open ( rs, "select foo from bar", cnc )
>
> but I dunno. I'm just thinking out loud..
>
yes, it might make sense. In fact, for GNOME 2, I'm reviewing all APIs,
so I will be removing some crappy code there is still in libgda, and
make a cleaner interface, so I add this to the list of things to be
done.
 
> <SNIP>
> 
> > to get the fields:
> > 
> > for (cnt = 0; cnt < gda_recordset_rowsize (recset); cnt++) {
> > 	GdaField *field = gda_recordset_field_idx (recset, cnt);
> > 	...
> > }
> > 
> > you've got also gda_recordset_field_name, to retrieve a field by its
> > name. Once you get a valid GdaField from a GdaRecordset, this GdaField
> > represents a given field in the current row. To access the contents of
> > the field, just use the #define's in gda-field.h, which allow you to get
> > it in different data types. Also, you can get the contents as a string,
> > by calling gda_field_stringify
> > 
> > I've cleaned up the API for GdaField's a lot for GNOME 2, so the
> > ugliness of that code will disappear shortly.
> 
> Hrmmm.. I need to play with this more, now that I see it, but my first initial
> reaction is fear and horror. This actually appears to be the first thing that
> ADO does a lot nicer than gnome-db. ie,  recordset.fields.value("field_name") 
> is much easier to code than 
> 
yes, I know the API for GdaField is quite ugly. I've rewritten it
entirely for GNOME 2 (libgda/lib/gda-common/gda-field.[ch] in CVS HEAD).

> gda_field_stringify( gda_recordset_field_name( rs, "field_name ") 
> I'm not sure this even will work does it?  Also, gda_field_stringify 
> wasn't in the online docs, did you mean gda_stringify_value ? or?
> 
yes, sorry, I meant gda_stringify_value

cheers
-- 
Rodrigo Moya <rodrigo gnome-db org> - <rodrigo ximian com>
http://www.gnome-db.org/ - http://www.ximian.com/




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