SQL Backend?
Albert Lash
albert.lash at gmail.com
Sat Jul 21 13:50:35 EDT 2007
Yep, thanks for digging the gnc-transaction-gda.c code up. This is
sort of what I was looking for:
107 static col_cvt_t split_col_table[] =
108 {
109 { "guid", CT_GUID, 0, COL_NNUL|COL_PKEY, NULL,
110 get_guid, set_guid },
111 { "tx_guid", CT_GUID, 0, COL_NNUL, NULL,
112 get_split_tx_guid, set_split_tx_guid },
113 { "memo", CT_STRING, SPLIT_MAX_MEMO_LEN,
COL_NNUL, SPLIT_MEMO },
114 { "action", CT_STRING, SPLIT_MAX_ACTION_LEN,
COL_NNUL, SPLIT_ACTION },
115 { "reconcile_state", CT_STRING, 1, COL_NNUL, NULL,
116 get_split_reconcile_state, set_split_reconcile_state },
117 { "reconcile_date", CT_TIMESPEC, 0, COL_NNUL, NULL,
118 get_split_reconcile_date, set_split_reconcile_date },
119 { "value", CT_NUMERIC, 0, COL_NNUL, NULL,
120 get_split_value, set_split_value },
121 { "quantity", CT_NUMERIC, 0, COL_NNUL, NULL,
122 get_split_quantity, set_split_quantity },
123 { "account_guid", CT_GUID, 0, COL_NNUL, NULL,
124 get_split_account_guid, set_split_account_guid },
125 { NULL }
126 };
127
128 static col_cvt_t guid_col_table[] =
129 {
130 { "tx_guid", CT_GUID, 0, 0, NULL, get_guid, set_guid },
131 { NULL }
132 };
Am I correct in my assumption that this code isn't actually used with
the current, non-SQL, backend? I did a little reading on the GnuCash
backend (QOF) and it seemed to me that there was a fair amount of
abstraction going on.
My feelings about the "bookkeeping model" are that given its maturity
(several hundred years old now) and simplicity, there isn't really
much use to "variations on a theme", so it should be feasible to have
a agnostic backend. That sounds kind of funny. :-)
Anyway, along these lines, I've been reading the xbrl specs (very good
stuff) for inspiration in the pbooks data model. They've done a great
job of modeling the bookkeeping and accounting concepts and although
I've merged some of their XML schema into the pbooks SQL model, it
would be nice to have some more convergence on these well defined data
structures.
Thoughts? I'm doing a bunch of work on pbooks right now and if any of
it can benefit gnucash, I'll try to make it to happen.
Albert
More information about the gnucash-devel
mailing list