DB design document

Derek Atkins warlord@MIT.EDU
18 Dec 2000 13:20:17 -0500


grib@gnumatic.com (Bill Gribble) writes:

> On Mon, Dec 18, 2000 at 01:00:56PM -0500, Derek Atkins wrote:
> > This is a reasonable approach, although I think we still want (need?)
> > to be flexible enough to make some rather robust queries.  For
> > example, I can certainly see where you might want to search for
> > transactions in an account between specific dates, or certain reports
> > might want to make certain more extensive queries.  
> 
> I think at the minimum any database backend should support the
> complete gnucash query API as it exists now (src/engine/Query.c).
> 
> That's not terribly complicated: just AND-OR trees of simple terms
> where each term consists of one of about 6-8 different predicates and
> a handful of parameters.  Value comparisons, date range comparisons,
> string comparisons, etc.  I would expect most of the predicates to be
> either directly supported or simple to code in any real database, with
> the possible exception of regular expression matching in strings, and
> the and-or structure could be trivially traversed (I think) to create
> a single SQL query statement.
> 
> Bill Gribble

Ahh, wonderful..  The RPC would only need to implement the equivalent
of 'xaccQueryGetSplits()' :) So, we get our batching for free,
provided that the UI doesn't call GetSplits() on every change to the
Query object.  That makes life really simple.

Wonderful!

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available