Updated DDL for SQL backend

Derek Atkins warlord at MIT.EDU
Sat Oct 28 11:05:32 EDT 2006


Josh Sled <jsled at asynchronous.org> writes:

> On Fri, 2006-10-27 at 12:04 -0400, Derek Atkins wrote:
>> Josh Sled <jsled at asynchronous.org> writes:
>> 
>> > There's a deeper modeling issue with SXes. We use a seperate, parallel
>> > AccountGroup to store template transaction data, in which Accounts are
>> > named as the string representation of the SXes GUID, and contain
>> > Transactions with Splits which have their *real* Accounts, as well as
>> > the credit and debit cell text formulae, in KVP frames.
>> 
>> I know David was working to re-model the AccountGroup...
>
> True, though as I recall by giving Accounts self-hierarchy (rather than
> with the current object + container system).  So long as that's true,
> then the book can contain a reference to the SX Account object graph
> along side the "normal" Account object graph.
>
> Either way, it becomes more of an issue in the DB, though, since it'll
> be easier to write an incorrect query like {select * from accounts where
> type = 'asset'} that would pick up SX accounts that aren't really part
> of the "normal" hierarchy.  As well, modifying the query to be correct
> is actually a PITA, as you'd want to walk the tree to make how it's
> rooted (either as the SX tree or the "normal" tree), and dbs generally
> don't play nicely with hierarchical relationships. :/
>
> I don't have a good solution, at present ... just bringing it up.
> Probably the right thing is for SXes to just suck it up and model
> template transactions seperately from the "real"
> accounts/transactions/splits, though there's some serious downsides
> there, too.

Actually, for Accounts it doesn't matter..  GnuCash always pre-loads
the full set of accounts.  I think it's safe to pre-load the full set
of SX accounts, too.  So we're never really performing queries for
Accounts based on AccountGroup.

However, we may want to query for Splits by AccountGroup...  And
these queries are recursive through the AccountGroups..  *ponders*

-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 at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list