Re: [gnome-db] database xml - database version property



On Thu, 2003-08-21 at 15:10 +0200, Philippe CHARLIER wrote:
> [From thread "database xml"]
> 
> Hi,
> 
> The change made to line 498 of the file "gda-xml-database.c", in the
> function "gda_xml_database_to_string()" solves the problem but render
> the function "gda-database-set-version()" useless.
> 
well, in fact, I think set_version should be removed, since the version
field is an information field, used to know the version used to create
the file.

So I think we should probably remove it. Or is there any case where you
want to set an explicit version number?

> In fact, the user cannot define the version of the database, with this
> code, the version is always <database name="name" version="xxxx"> with
> xxxx being the libgda version number (0.91.0 f.e.).
> 
> Is it not possible to have something like below ?
> 
> <database name="name" gdaversion="xxxx" version="yyyy"> with xxxx being
> the libgda version number and yyyy the database version defined by the
> application.
> 
yes, that's possible. If you want, please make the changes yourself and
send the patch to the list. It would just mean replacing the 'version'
field with 'gdaversion', and then having the get_version/set_version
work on the new 'version' field on the XML file.

Also, a gda_xml_database_get_gda_version would be needed then.

> This way, if the application modifies its way of saving data, by keeping
> track of the database version, it will be possible to find out if the
> actual version of the application is able to read the xml file or if it
> needs a filter to convert the database to the new format.
> 
yes, sounds good.

> But this, of course, needs other modifications to add the property
> "gdaversion" (GdaXmlDatabasePrivate, I suppose ... and may be more), so
> I do not know if this is possible. 
> 
yes, it's perfectly possible. Just make the current 'version' be
replaced by 'gdaversion' and add the 'get_gda_version' function. That's
all.

cheers




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]