DBI backend status

Phil Longstaff plongstaff at rogers.com
Thu Jul 31 19:43:15 EDT 2008


Derek Atkins wrote:
> This is somewhat orthogonal to the 2.2.6 release.  The 2.2 releases
> come off the 2.2 branch, not off trunk.  The only major issue is
> divergence.  The more trunk diverges the harder it is to cherry-pick
> changesets for backport to 2.2.
> 
> However, if you feel that the DBI code is ready to get wider
> testing then yes, by all means let's move it into trunk.  Keep in mind
> that I think that:
> 
> 1) it should not be required at first (there should remain a
>    --enable-dbi configure script)

OK - It was --disable-dbi, but I'll reverse it.

> 2) it should not be the default "file" backend (yet -- it should
>    be easy to eventually flip a switch to convert from XML to
>    SQLite as the 'default' file backend).

This could easily be done by registering the xml backend first, then the
dbi backend, since both register "file://".  However, Save As would
always save as xml, not sqlite3, since it would come first in the list.
 Also, there is no way to specify anything other than file:// in the
current dialog.

If I leave it as it is (sqlite3 registers before xml), it has the
following behavior:
1) if you open an xml file, it will load as an xml file
2) if you open an sqlite3 file, it will load as an sqlite3 file
3) if you save, it will save to the current file in whatever format it
currently has
4) if you save-as to a new file, it will save as sqlite3
5) if you save-as to an existing xml file, it will overwrite the xml
file and save as an xml file (assuming you agree to overwrite)

I haven't tried it, but i assume if you save-as to an existing sqlite3
file and agree to overwrite, it will overwrite the file and save in
sqlite3 format.  I don't know what will happen if you overwrite a file
in any other format.  I don't know how it will save.

> 3) we will need a tool (eventually) to do migration from XML to
>    SQLite once we do make the switch.

This can be as simple as load, save-as, rename.

One note that I should add is that sqlite3 files take up a *lot* more
room than the gzipped xml files.  My current book takes about 1.3 MB as
gzipped xml, but about 7.5MB as an sqlite3 file.

> I'll note that I have not (yet) tried to build your branch on my
> F7 system.

Phil



More information about the gnucash-devel mailing list