Re: GTK - reading data from database



Am Mittwoch, den 30.07.2008, 18:33 -0700 schrieb paragasu:
> i am writing a gtk application to interface with postgresql database.
> the database contain few hundred rows. how programmer usually do this,
> the load the entire database content to app or just load part of it?

First of all I'd suggest to have a look at libgda[1]. This library
abstracts database access and also provides widgets for database access.
Maybe those guys already invented the wheel you need.

Otherwise I'd implement a custom list store, which first just do a
"SELECT COUNT(*) ..." query to create empty rows, and then only fetches
rows from the database when some range with still empty rows get
visible. You'll easily detect the need for fetching more rows by waiting
for the tree view calling your list store's get_value() method.

Ciao,
Mathias

[1]: http://www.gnome-db.org/
-- 
Mathias Hasselmann <mathias hasselmann gmx de>
Openismus GmbH: http://www.openismus.com/
Personal Site: http://taschenorakel.de/

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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