C-API and mysql connection

John Ralls jralls at ceridwen.us
Tue Jun 17 09:57:55 EDT 2014


On 17 Jun 2014, at 06:44, Kristoffel De Geest <kdg1955 at gmail.com> wrote:

> As an experienced C programmer, I tried to delve into the C-API of GnuCash.
> Everything seems very straightforward. But I sucker on one important point:
> how do I link the mysql data to the QofBook structure.
> Presumably "gnc_sql_init" and "gnc_sql_load" are the appropriate functions.
> But here I can not find any parameter for the connection string (eg
> mysql://myName@myhost/myDB). Or I find nowhere a function that initializes
> all this via configuration files.
> Is there a template available that can solve my problem or is there a
> sample source file? The sample programs found at "
> http://wiki.gnucash.org/wiki/C_API" give no clarity. Even Google could not
> help me.
> 
> BTW: the purpose of the C-API application is to import several hundred
> commodities (one shot) and the latest prices (daily run).
> Maybe the import of the prices can be done inside GnuCash via the import of
> a QIF file (not yet tried) but I prefer to automate this. However the
> import of new commodities failed with a QIF file because GnuCash try to
> create directly the accounts, and propose me to enter the missing
> commodities one by one. Version of GnuCash: 2.4.15 (Fedora package)
> 
> It is not clear to me whether this is the right mailing list for my C-API
> problem. If "gnucash-devel" is more appropriate, I will also ask my
> question there.
> 

src/backend/sql is the generalised interface; it operates through src/backend/dbi which handles the specialisation necessary for each supported SQL engine.

All of the active devs are on both lists, so for this question it doesn't matter.

Regards,
John Ralls




More information about the gnucash-user mailing list