# Migration from 1.x versions to 2.x versions

## GdaValue and GdaDataModel changes

Libgda values were stored in GdaValue structures, this is no longer the case as the standard GValue container is now used. As a consequence data types are now identified by their GType identifier, there is thus no more any GdaType definition.

The GdaDataModel has been transformed into an interface (as defined by the Glib object system), and the old GdaDataModel has been replaced by the GdaDataModelRow class. No code using the GdaDataModel should assume that data is internally stored as rows (vectors) of values as it was the case in the previous stable release.

In the new version, many objects implement the GdaDataModel interface for various usages which did not exist in the previous version such as data import and filtering. GdaDataModel objects should now be considered as non writable, and if they need to be modified, the modifications permissions should be checked using the `gda_data_model_get_attributes_at()` function. See the section about the various data models for more information.

The following UML schema shows the various implementations of the GdaDataModel interface and what they are for. Note that the GdaDataModelRow should not be instantiated directly but either used as a base class, or used through its children classes.

Various implementations of the GdaDataModel interface

## GdaClient, GdaConnection and GdaError

The GdaClient usage has remained unchanged except for some small API alterations and a specific API has been defined to create and destroy databases.

The GdaError class has been renamed to GdaConnectionEvent and can now convey not only errors but also other kind of events which have happened on a connection

The GdaConnection usage has remained by far unchanged, but some of its API have had some alterations (finding the equivalent is trivial). The most noticeable change being that the `gda_connection_escape_string()` has been removed because string escaping is now done by a GdaDataHandler object which each GdaServerProvider provides for each data type.

## Various API changes

- GdaFieldAttributes has been renamed GdaColumn

- The GdaParameter is now an object, and it is extensively used within GdaParameterList objects. Each GdaParameterList object represent a vector of parameters (which may or may not have values assigned) and is the base of the GdaDataModelIter iterator object. The GdaParameter API has been altered.

- The GdaExport class has been removed, the features it offered are now implemented in each GdaDataModel object.

- GdaSelect has been renamed GdaDataModelFilterSQL

- The GdaTable class has been replaced by the GdaDataModelQuery class: it's a data model which can refresh itself and can be configured to be updatable, it's not limited to a database table.

- The GdaXmlDatabase has been removed and the default database is now SQLite which is a complete RDBMS in a file

- All the `gda_xql_*()` functions have been removed because they were unused and unmaintained.

- The 'xml' provider has been removed as it did not work correctly and has been replaced by the SQLite provider as the provider to have serverless databases.