cmd line: import of transactions and invoice data

Jannick at
Tue Dec 31 16:15:28 EST 2013

John Ralls <jralls <at>> writes:

> It updates the database after any change to the in-memory data. At least we
> think it does, but we don’t yet have complete test coverage to be sure that
> we haven’t missed something in our audits.


this is very helpful.

There might be two options: Either the whole db is updated or the changes
only [Rereading the posting: only changed tables are updated - at most]. 

The first one might give rise to an issue when more than one user updates
the mySQL db at the same time. But good either way I believe if there is
just one user having access to the mySQL db for a period of time. If the
whole GC db is - or updated GC tables as a whole are - passed on to mySQL,
then the data integrity feature built into GC can be used and need not be
mirrored in mySQL. Point taken!
> >
> >> However, GnuCash DOES NOT support you writing to the database behind it. 
> >> To write the DB you *MUST* use the GnuCash API (in C, Scheme, or Python).
> > 
> > This *is* a very good point. For the benefit of my better understanding:
> > Given my first guess above is correct, then how does GC work when it comes
> > to manually input data or insert it via the AqBanking interface (HBCI)? What
> > does it do when information are handed in?
> It parses the incoming stream and converts it to internal data structures,
> the user via a dialog box to assign the accounts for each side of the
> then runs data-integrity routines on each transaction to ensure that the
> balances, creating an imbalance-account-split if it doesn’t. If you’re
using the SQL
> backend it updates the various affected tables immediately, otherwise it
sets the
> book dirty flag.

Ahh, then the number of updated tables is reduced to the minimum after the
GC data-integrity test for the whole in-memory GC db. And - as far as I
understand - the *whole* updated tables are passed on to mySQL, right?

Just two more FUP questions:
1 - What happens if GC comes across a db which fails the data-integrity
tests (because, e.g., it was updated outside the house)? Is GC able to cope
with this still displaying the db to the GC user?
2 - I am a little tiny Win7 user (no "building" skills etc). Are there any
code pieces to read to understand how the various steps are applied to
imported transactions? Anything on the GC server?

> Regards,
> John Ralls

This is much appreciated!

Have a great 2014!

More information about the gnucash-devel mailing list