How to test w/o committing

16 views
Skip to first unread message

Jeffrey Honig

unread,
Dec 19, 2017, 6:13:44 PM12/19/17
to piecash
As I'm developing my code I'd like to do test transactions.  Basically create the transaction, print it out with ledger() but not commit it.

It seems piecash (or the SQL lib) wants to auto-flush the transaction.

If I use book.cancel() at the end of my transaction(s) will that prevent it from being commited?

Thanks.

Jeff

sdementen

unread,
Jan 28, 2018, 8:19:41 AM1/28/18
to piecash
hello Jeff,

Indeed, the cancel should remove all the changes you have done.

Always make a backup before changing your gnucash book! If you use the sqlite backend, you can use the do_backup argument of open_book (see http://piecash.readthedocs.io/en/latest/api/piecash.core.session.html#piecash.core.session.open_book)
Reply all
Reply to author
Forward
0 new messages