From cde3a6ea7136f5d6664dc5205d784c0217baee03 Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Mon, 25 Jul 2022 15:13:07 -0700 Subject: [PATCH] Add description to output tables --- src/db.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/db.py b/src/db.py index f70347b..cd0bf89 100644 --- a/src/db.py +++ b/src/db.py @@ -44,6 +44,7 @@ def create_tables(cursor: sqlite3.Cursor) -> None: ( id integer, date text, + description text, comment text, cleared integer, tags text @@ -57,6 +58,7 @@ def create_tables(cursor: sqlite3.Cursor) -> None: ( transaction_id integer, date text, + description text, account text, amount real, cleared integer, @@ -106,14 +108,15 @@ def write_transactions(cursor: sqlite3.Cursor, txs: List[Transaction]) -> None: """ INSERT INTO transactions ( - id, date, comment, cleared, tags + id, date, description, comment, cleared, tags ) VALUES ( - ?, ?, ?, ?, ? + ?, ?, ?, ?, ?, ? ) """, [ transaction.get("tindex"), transaction.get("tdate"), + transaction.get("tdescription"), comment, transaction.get("tstatus"), ",".join(transaction.get("ttags") or []), @@ -143,14 +146,15 @@ def write_transactions(cursor: sqlite3.Cursor, txs: List[Transaction]) -> None: """ INSERT INTO postings ( - transaction_id, date, account, amount, cleared, tags, comment + transaction_id, date, description, account, amount, cleared, tags, comment ) VALUES ( - ?, ?, ?, ?, ?, ?, ? + ?, ?, ?, ?, ?, ?, ?, ? ) """, [ transaction.get("tindex"), transaction.get("tdate"), + transaction.get("tdescription"), posting.get("paccount"), get_posting_amount(posting), status,