SQL tables for GnuCash Business Objects?

Linas Vepstas linas at linas.org
Thu Oct 2 11:13:40 CDT 2003

Hi Matthew,

Have you perchance designed an SQL tables for the business objects?
I'm reaching a point in the coding where I'll need these soon.

Since, ahh, what I'm working on is kind of on a collision course with 
your stated goals of working on the SQL backend, I figured that maybe
I ought to apprise you of this ... :-)

I'm currently tearing up the guts of "DWI" http://dwi.sourceforge.net
DWI was originally (and still is) a way of 'quickly' developing glade
apps that are hooked to an SQL db.  I wrote a kind of tracking tool
using the thing for a client (tracking maintenance of pipes & pumps),
so DWI has been vetted with a 'real life' project.  I've been planning
on creating a whiz-bang open source bug tracker & etc with it, but
never got around to it.

My tear-up of the guts of DWI is turning it into a generic 'data pump'.
It can suck data out of one place and stick it in somewhere else. 
Originally, the two places it worked with are sql tables and gnome
widgets, but its in fact far more general than that.  In particular,
I'm planning on prototyping a hookup to the GnuCash objects (aka qof
objects) real soon now.  (which is why the qof objects get setters as
well as getters in the CVS tree).

Part of the beauty of the thing is it does not force a 1-to-1 mapping
between SQL tables and objects.  The mappings can go any which way: 
data from different sql tables can be joined and pushed out to various
assortments of widgets (including columned widgets such as ctree/clist).
So its kind of a realization of my long standing complaint that I should
be able to press a button, and bingo, some object turns into an SQL
record(s), and back. 

I'm not done with the DWI internal tearup yet, but soon ... After that,
I'll start prototyping integration with the qof objects (probably within
the DWI cvs tree).  When I'm done with that, I'm going to try to unleash
the thing to create teh backend for the GnuCash business Objects.  My
goal is to have very very little code for this: mostly, a specification
of the SQL tables, and a mapping: 'this business object field goes into
that sql field', and that's that.  The goal/side effect is that this
should make adding new objects to GnuCash backend 'real easy'.

Depending on how the above goes, I may or may not convert the existing
sql backend to use this new system.  Although not in my current set of
plans, note that DWI also offers a way of maybe simplifying the GUI
design as well, providing a way of hooking glade dialogs straight to
engine objects (and/or god forbid straight to sql). But that's really 
not something I'm planning for right now. 


pub  1024D/01045933 2001-02-01 Linas Vepstas (Labas!) <linas at linas.org>
PGP Key fingerprint = 8305 2521 6000 0B5E 8984  3F54 64A9 9A82 0104 5933

More information about the gnucash-devel mailing list