UI to access db

Phil Longstaff plongstaff at rogers.com
Fri Dec 28 16:58:17 EST 2007


Well, I guess it's time to tackle the db selection/UI issues.

The gda backend accepts URLs:
    - gda://<provider>:<dbname>
    - gda://@<gda_config_name>

where <provider> is the provider name ("sqlite", "mysql" or "pgsql").  
If the first form is used, for mysql and pgsql, the dbname is the name 
of the database, while for sqlite, the dbname is the name of the dbfile 
(libgda adds ".db" to the end of the db file).  If the second form is 
used, gda_config_name is the name of a libgda configuration stored in 
~/.libgda/config (I believe libgda supplies a tool to configure these).

It also accepts file://<filename> URLs.  If the filename has the ".db" 
suffix, then it will be used if it exists and is an sqlite file or if it 
doesn't exist.  If it doesn't have the ".db" suffix, then it will be 
used if it doesn't exist.  This leaves the XML backend to handle 
xml://<filename> URLs and file://<filename> URLs where either the 
filename has ".db" but isn't an sqlite file, or doesn't have ".db" and 
does exist.

The current file-based Open/Save As dialogs will work for XML and sqlite 
files, but not for the other db engine databases.

Possibilities:
1) Modify the Open/Save As dialogs to allow it to handle gda:// URLs.
2) Leave Open/Save As to handle files, and add a "DB Connection" menu 
item/dialog.  If there was a session active, this user could save the 
contents to the session (or not) and could load the db.  This provides 
the db counterparts to Save As and Open respectively.

My preference is for #2.  Of course, the DB connection dialog would 
create the gda:// URL which would then be persisted from session to session.

Phil


More information about the gnucash-devel mailing list