sqlite file format, anyone?

Linas Vepstas linas at linas.org
Sun Jun 22 00:51:42 CDT 2003


On Sat, Jun 21, 2003 at 11:35:44PM -0500, Matthew Vanecek was heard to remark:
> On Sat, 2003-06-21 at 22:54, Linas Vepstas wrote:
> > On Sat, Jun 21, 2003 at 10:07:18PM -0400, Derek Atkins was heard to remark:
> > > Matthew Vanecek <mevanecek at yahoo.com> writes:
> > > 
> > > > KVP tables.  
> > 
> > I'm going to play dumb for a moment.  What's wrong with storing the 
> > triplet (keypath,value,guid-of-parent) where 'keypath' is the 
> > slash-delimited list of keys? 
> > 
> > > > go backwards (i.e., refer back to *whatever* table from the KVP table
> > > > based on the GUID).
> > 
> > Wouldn't this be solved by (keypath,value,guid-of-parent,type-of-parent)?
> 
> Not really, unless you used table-name for type-of-parent.  In

Yes, table name. Or maybe gncOject->name which should map 1-1 to a table
name.  Or maybe we add a 'table-name' field to gnc-object?

> Too late, already started.  Trying to fit it in around work and life is
> a bitch, but I manage to get a bit done here and there.  Right now I'm

No kidding.

> Anyhow, a lot of the queries can be standardized on the SELECT/FROM
> side--it's mainly the WHERE and ORDER BYs that are truly dynamic.

If you haven't looked at 'builder.c' then *please* review at least that.
If you haven't already duplicated this code. 

If you haven't looked at qof yet, then *please* visit qof.sourceforge.net
and just scan the names of the files in the cvs tree. They are *identical*
to the gnucash files.  qof consists of gncobject, gncbook and gncsession
and gncbackend and kvp and date/time. that's it. Only the generic stuff.

I am hoping that 90% of what you do, especially in the early stages,
can be copied directly into qof.  The idea being to have a generic
sql backend for generic objects.  (There still needs to be a layer that
knows explicitly about account balances, etc. but that's a different 
matter).

> I tried the m4 route, too, for initial generation.  I think it works
> well for that--getting the code base started.  It's difficult to
> maintain, though.

Yeah.  I would be much happier if we avoided m4 entirely, and did no
autogened code, and instead make the queries be truly run-time generic.
This, however, requires adding setters (not just getters) to the gncobject.

--linas

-- 
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