New Hacker

Josh Sled jsled at
Thu Sep 1 19:07:39 EDT 2005

On Thu, 2005-09-01 at 15:19 -0700, Mike B wrote:
> Hey everyone, I've just been playing around with the
> GNUCash source for the first time, and I'm having a
> little trouble.  I haven't seen anything in the design
> documents about how account data is organized and how
> the object mapping interfaces with that, so I'm having
> trouble making the queries that I want to make.

Account data is primarily organized in the engine's data objects, which
are located in src/engine/.  The business module is nicely
compartmentalized into src/business/, and it's "engine"-equivalent is in

The primary data file is XML, and it pretty literal/readable.  The
"object mapping" paradigm for this "file backend" is one of
(un)serialization; the sources are located in src/backend/file/.

The PG backend is deprecated; in particular, it doesn't support the
business or scheduled transactions objects... or anything new-after-1.6.

> I think it's interesting that when someone like me is
> first getting into the GNUCash source, what I really
> want is a database schema and access to SQL queries. 
> I'm sure that I'll learn to appreciate the OR mapping
> layer, but right now I'm just confused.

What database schema?  What SQL queries?  What OR mapping layer?
GnuCash doesn't have these things, in the same way other systems do.

You should take a good look at QOF, however.  It's not an OR mapping
layer so much as a mappable object model ... i.e., queries expressed
over in-memory QOF object-graphs can be translated into SQL.  I'm still
not sure how it handles data-modificiation, though.

But in any case, gnucash isn't built up around a relational data model
in the way you seem to expect it to be.  Think about it in terms of the
runtime, in-memory object graph.


-- - `a=jsled;; echo ${a}@${b}`

More information about the gnucash-devel mailing list