[Kmymoney-devel] Allow plugins to access the database

Christian Dávid christian-david at web.de
Wed Feb 12 13:13:09 UTC 2014


Hello,
hello Fernando,

this is for the online banking function I am currently working on. But it is 
useful for other plugins as well and would be a major change to KMyMoney:

I want to enable plugins to store information (probably a lot of information). 
For XML files I solved this by adding a MyMoneyObject with general information. 
The data from the plugin is attached as a pointer. To write/read the data a 
virtual method is used.

Obviously this is not that easy with the database, as a table has to be 
created first. So I want plugins to be allowed to check if the storage can 
process SQL (e.g. with bool MyMoneyFile::isSqlDatabase() ) and allow them to 
directly execute SQL queries. If they want, they can use KMyMoney's database 
abstraction.

Also the plugin should tell KMyMoney an SQL query which reverts the changes. 
It is stored as a string (in the database). Then KMyMoney can offer the user to 
remove all data from a plugin — even if it is no longer available.

I thought about using the Key-Value-Container. But this *could* create 
performance issues (a credit-transfer exists of ~13 fields, in the long run I 
expect every transaction to be based on such a credit-transfer, for online 
banking users). There would be many, many joins. Personally I find this would be 
a bad hack anyway.

Do you like my idea?

Greetings
Christian

P.S.: Take your time for answers, I won't be able to work on this in the next 
weeks anyway.


More information about the KMyMoney-devel mailing list