The database system.
Account Table.
Fields
ID
Object ID
Contact [contact]
OwnerID [Account]
Institution [Account]
Currency [currency]
AccountNumber
This table holds 1 set of contact data for itself. It also contains 2 links to accounts, one for the owner or parent and one for the institution it belongs to ( could be 0).
There are several other tables
ac_dividend, ac_trade, ac_transaction, ac_document, ad_dailyhistory, ad_dividendhistory, ad_fundamental, ad_realtime, ad_split etc. These tables contain an AccountID field and will be searched by the program when loading an account to provide data relevant to that account. There are currently 12 such tables programmed for and is intended to be extendable as not all instruments have been planned for yet.
Ancillary tables
basecountry, baseinstrument, basemarket, basesector, are all base type tables that contain data that should rarely change.
The last group of tables is the object group.
Everything is an object, hence if a history record is written an object record is written. Objects can have links. So if you wanted to link a document to multiple accounts, you could create 2 object links. Tagging is also supported, the objecttaglist is the current list of tags, objecttag is then a link between that object and the objecttag. In this way multiple objects can have multiple tags.
Currently the only instrument we are concerned with are stocks. However the system has been built broad enough to cater for bonds, futures, options, currency etc.
Stored procedures will be used sparingly as not all Databases use stored procedures ie sqlite.