<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
     "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY nbsp            " ">
<!ENTITY LIBGDA          "<application>libgda</application>">
<!ENTITY GNOMEDB         "<application>GNOME-DB</application>">
<!ENTITY igalia          '<emphasis><ulink url="http://www.igalia.com">Igalia, S.L.</ulink></emphasis>'>
<!ENTITY xobas           '<emphasis><ulink url="http://www.xobas.com">Xobas Software</ulink></emphasis>'>
<!ENTITY API             "<acronym>API</acronym>">
<!ENTITY DBMS            "<acronym>DBMS</acronym>">
<!ENTITY DSN             "<acronym>DSN</acronym>">
<!ENTITY ODBC            "<acronym>ODBC</acronym>">
<!ENTITY GDA             "<acronym>GDA</acronym>">
<!ENTITY LDAP            "<acronym>LDAP</acronym>">
<!ENTITY CORBA           "<acronym>CORBA</acronym>">
<!ENTITY IDL             "<acronym>IDL</acronym>">
<!ENTITY ORB             "<acronym>ORB</acronym>">
<!ENTITY SQL             "<acronym>SQL</acronym>">
<!ENTITY RPM             "<acronym>RPM</acronym>">
<!ENTITY XML             "<acronym>XML</acronym>">
<!ENTITY PGSQL           "<application>PostgreSQL</application>">
<!ENTITY MYSQL           "<application>MySQL</application>">
<!ENTITY ORAC            "<application>Oracle</application>">
<!ENTITY INTERB          "<application>Interbase</application>">
<!ENTITY SYBASE          "<application>Sybase</application>">
<!ENTITY MSACC           "<application>MS Access</application>">
<!ENTITY INFOR           "<application>Informix</application>">
<!ENTITY GDASERVERPROVIDER "<link linkend='GdaServerProvider'>GdaServerProvider</link>">
<!ENTITY GDADATAMODEL    "<link linkend='GdaDataModel'>GdaDataModel</link>">
<!ENTITY GDADATAMODELARRAY "<link linkend='GdaDataModelArray'>GdaDataModelArray</link>">
<!ENTITY GDADATAMODELHASH "<link linkend='GdaDataModelHash'>GdaDataModelHash</link>">
<!ENTITY fullexample SYSTEM "examples/full_example.c">
<!ENTITY install SYSTEM "installation.xml">
<!ENTITY examples SYSTEM "gettingstarted.xml">
<!ENTITY migration SYSTEM "migration.xml">
<!ENTITY libgda-GdaBlob SYSTEM "xml/gda-blob.xml">
<!ENTITY libgda-GdaClient SYSTEM "xml/gda-client.xml">
<!ENTITY libgda-GdaCommand SYSTEM "xml/gda-command.xml">
<!ENTITY libgda-config SYSTEM "xml/gda-config.xml">
<!ENTITY libgda-GdaConnection SYSTEM "xml/gda-connection.xml">
<!ENTITY libgda-GdaThreader SYSTEM "xml/gda-threader.xml">
<!ENTITY libgda-GdaDataModelArray SYSTEM "xml/gda-data-model-array.xml">
<!ENTITY libgda-GdaDataModelQuery SYSTEM "xml/gda-data-model-query.xml">
<!ENTITY libgda-GdaDataModelHash SYSTEM "xml/gda-data-model-hash.xml">
<!ENTITY libgda-GdaDataModelRow SYSTEM "xml/gda-data-model-row.xml">
<!ENTITY libgda-GdaDataModel SYSTEM "xml/gda-data-model.xml">
<!ENTITY libgda-GdaDataModelIter SYSTEM "xml/gda-data-model-iter.xml">
<!ENTITY libgda-GdaDataModelImport SYSTEM "xml/gda-data-model-import.xml">
<!ENTITY libgda-GdaDataAccessWrapper SYSTEM "xml/gda-data-access-wrapper.xml">
<!ENTITY libgda-GdaDataProxy SYSTEM "xml/gda-data-proxy.xml">
<!ENTITY libgda-GdaConnection-event SYSTEM "xml/gda-connection-event.xml">
<!ENTITY libgda-GdaColumn SYSTEM "xml/gda-column.xml">
<!ENTITY libgda-GdaColumnIndex SYSTEM "xml/gda-column-index.xml">
<!ENTITY libgda-GdaDataModelIndex SYSTEM "xml/gda-data-model-index.xml">
<!ENTITY libgda-init SYSTEM "xml/libgda.xml">
<!ENTITY libgda-log SYSTEM "xml/gda-log.xml">
<!ENTITY libgda-GdaParameter SYSTEM "xml/gda-parameter.xml">
<!ENTITY libgda-quark-list SYSTEM "xml/gda-quark-list.xml">
<!ENTITY libgda-GdaRow SYSTEM "xml/gda-row.xml">
<!ENTITY libgda-GdaDataModelFilterSQL SYSTEM "xml/gda-data-model-filter-sql.xml">
<!ENTITY libgda-GdaServerProvider SYSTEM "xml/gda-server-provider.xml">
<!ENTITY libgda-transaction SYSTEM "xml/gda-transaction.xml">
<!ENTITY libgda-util SYSTEM "xml/gda-util.xml">
<!ENTITY libgda-GdaValue SYSTEM "xml/gda-value.xml">
<!ENTITY libgda-report-types SYSTEM "xml/gda-report-types.xml">
<!ENTITY libgda-report-document SYSTEM "xml/gda-report-document.xml">
<!ENTITY libgda-report-item SYSTEM "xml/gda-report-item.xml">
<!ENTITY libgda-report-item-detail SYSTEM "xml/gda-report-item-detail.xml">
<!ENTITY libgda-report-item-label SYSTEM "xml/gda-report-item-label.xml">
<!ENTITY libgda-report-item-pagefooter SYSTEM "xml/gda-report-item-pagefooter.xml">
<!ENTITY libgda-report-item-pageheader SYSTEM "xml/gda-report-item-pageheader.xml">
<!ENTITY libgda-report-item-repfield SYSTEM "xml/gda-report-item-repfield.xml">
<!ENTITY libgda-report-item-report SYSTEM "xml/gda-report-item-report.xml">
<!ENTITY libgda-report-item-reportfooter SYSTEM "xml/gda-report-item-reportfooter.xml">
<!ENTITY libgda-report-item-reportheader SYSTEM "xml/gda-report-item-reportheader.xml">
<!ENTITY libgda-report-item-sqlquery SYSTEM "xml/gda-report-item-sqlquery.xml">
<!ENTITY libgda-report-result SYSTEM "xml/gda-report-result.xml">
<!ENTITY libgda-report-valid SYSTEM "xml/gda-report-valid.xml">
<!ENTITY libgda-GdaDict SYSTEM "xml/gda-dict.xml">
<!ENTITY libgda-GdaConnection SYSTEM "xml/gda-connection.xml">
<!ENTITY libgda-GdaObject SYSTEM "xml/gda-object.xml">
<!ENTITY libgda-GdaXmlStorage SYSTEM "xml/gda-xml-storage.xml">
<!ENTITY libgda-GdaDictType SYSTEM "xml/gda-dict-type.xml">
<!ENTITY libgda-GdaDictFunction SYSTEM "xml/gda-dict-function.xml">
<!ENTITY libgda-GdaDictAggregate SYSTEM "xml/gda-dict-aggregate.xml">
<!ENTITY libgda-GdaDataHandler SYSTEM "xml/gda-data-handler.xml">
<!ENTITY libgda-GdaHandlerString SYSTEM "xml/gda-handler-string.xml">
<!ENTITY libgda-GdaHandlerBoolean SYSTEM "xml/gda-handler-boolean.xml">
<!ENTITY libgda-GdaHandlerTime SYSTEM "xml/gda-handler-time.xml">
<!ENTITY libgda-GdaHandlerNumerical SYSTEM "xml/gda-handler-numerical.xml">
<!ENTITY libgda-GdaHandlerBin SYSTEM "xml/gda-handler-bin.xml">
<!ENTITY libgda-GdaHandlerType SYSTEM "xml/gda-handler-type.xml">
<!ENTITY libgda-GdaDictDatabase SYSTEM "xml/gda-dict-database.xml">
<!ENTITY libgda-GdaDictTable SYSTEM "xml/gda-dict-table.xml">
<!ENTITY libgda-GdaDictField SYSTEM "xml/gda-dict-field.xml">
<!ENTITY libgda-GdaEntity SYSTEM "xml/gda-entity.xml">
<!ENTITY libgda-GdaEntityField SYSTEM "xml/gda-entity-field.xml">
<!ENTITY libgda-GdaRenderer SYSTEM "xml/gda-renderer.xml">
<!ENTITY libgda-GdaReferer SYSTEM "xml/gda-referer.xml">
<!ENTITY libgda-GdaDictConstraint SYSTEM "xml/gda-dict-constraint.xml">
<!ENTITY libgda-GdaObjectRef SYSTEM "xml/gda-object-ref.xml">
<!ENTITY libgda-query-intro SYSTEM "query.xml">
<!ENTITY libgda-query-fields SYSTEM "query-fields.xml">
<!ENTITY libgda-GdaQuery SYSTEM "xml/gda-query.xml">
<!ENTITY libgda-GdaQueryObject SYSTEM "xml/gda-query-object.xml">
<!ENTITY libgda-GdaQueryTarget SYSTEM "xml/gda-query-target.xml">
<!ENTITY libgda-GdaQueryField SYSTEM "xml/gda-query-field.xml">
<!ENTITY libgda-GdaQueryFieldAll SYSTEM "xml/gda-query-field-all.xml">
<!ENTITY libgda-GdaQueryFieldField SYSTEM "xml/gda-query-field-field.xml">
<!ENTITY libgda-GdaQueryFieldFunc SYSTEM "xml/gda-query-field-func.xml">
<!ENTITY libgda-GdaQueryFieldAgg SYSTEM "xml/gda-query-field-agg.xml">
<!ENTITY libgda-GdaQueryFieldValue SYSTEM "xml/gda-query-field-value.xml">
<!ENTITY libgda-GdaQueryJoin SYSTEM "xml/gda-query-join.xml">
<!ENTITY libgda-GdaParameter SYSTEM "xml/gda-parameter.xml">
<!ENTITY libgda-GdaQueryCondition SYSTEM "xml/gda-query-condition.xml">
<!ENTITY libgda-GdaParameterList SYSTEM "xml/gda-parameter-list.xml">
<!ENTITY libgda-GdaGraphviz SYSTEM "xml/gda-graphviz.xml">
<!ENTITY libgda-GdaGraph SYSTEM "xml/gda-graph.xml">
<!ENTITY libgda-GdaGraphQuery SYSTEM "xml/gda-graph-query.xml">
<!ENTITY libgda-GdaGraphItem SYSTEM "xml/gda-graph-item.xml">
<!ENTITY libgda-Enums SYSTEM "xml/gda-enums.xml">
<!ENTITY fdl-appendix SYSTEM "fdl-appendix.sgml">
<!ENTITY libgda-TreeIndex SYSTEM "xml/tree_index.sgml">
]>

<book id="index">
  <bookinfo>
    <title>GNOME Data Access manual</title>
    <authorgroup>
      <author>
        <firstname>Michael</firstname>
        <surname>Lausch</surname>
        <affiliation>
          <address><email>michael.lausch@1012surf.net</email></address>
        </affiliation>
      </author>
      <author>
        <firstname>Rodrigo</firstname>
        <surname>Moya</surname>
        <affiliation>
          <address><email>rodrigo@gnome-db.org</email></address>
        </affiliation>
      </author>
      <author>
        <firstname>Vivien</firstname>
        <surname>Malerba</surname>
        <affiliation>
          <address><email>malerba@gnome-db.org</email></address>
        </affiliation>
      </author>
      <author role="clean up">
	<firstname>Sean</firstname>
	<surname>Allen</surname>
	<affiliation>
	  <address><email>zeroone@worldonline.co.za</email></address>
	</affiliation>
	<contrib>GDP compliance, FDL, added mark-up, English and syntax
        </contrib>
      </author>
      <author>
	<firstname>Xabier</firstname>
	<surname>Rodriguez Calvar</surname>
	<affiliation>
          <orgname>&igalia;</orgname>
	  <address><email>xrcalvar@igalia.com</email></address>
	</affiliation>
	<contrib>How to begin and migration formulae
        </contrib>
      </author>
      <author>
	<firstname>Jose</firstname>
	<surname>Dapena Paz</surname>
	<affiliation>
          <orgname>&igalia;</orgname>
	  <address><email>jdapena@igalia.com</email></address>
	</affiliation>
	<contrib>Some examples
        </contrib>
      </author>
      <author>
        <firstname>Bas</firstname>
        <surname>Driessen</surname>
        <affiliation>
          <orgname>&xobas;</orgname>
          <address><email>bas.driessen@xobas.com</email></address>
        </affiliation>
	<contrib>libgda, gda-postgres, gda-mysql
        </contrib>
      </author>
    </authorgroup>
    <date>1999 February</date>
    <copyright>
      <year>1999-2005</year>
      <holder>The GNOME Foundation</holder>
    </copyright>
    <abstract>
      <para>
        GNOME Data Access (&GDA;) is an architecture whose 
        purpose is to provide universal access to many different kinds and
        types of data sources. This goes from traditional relational database
        systems, to any imaginable kind of data source such as a mail server,
        a &LDAP; directory...
      </para>
      <para>
        This universality is obtained through the use of
        an easily extensible plug-in system as the mechanism for
	communication between the different components in the architecture.
      </para>
    </abstract>
    <legalnotice id="legalnotice">
      <para>
        Permission is granted to copy, distribute and/or modify this document
        under the terms of the <link linkend="fdl"><citetitle>GNU
        Free Documentation License</citetitle></link>, Version 1.1 or any later
        version published by the Free Software Foundation with no Invariant
        Sections, no Front-Cover Texts, and no Back-Cover Texts.  A copy of the
        license can be found in <link linkend="fdl">the appendix</link>.
      </para>
      <para>
        Many of the names used by companies to distinguish their products and
        services are claimed as trademarks. Where those names appear in any
        GNOME documentation, and those trademarks are made aware to the members
        of the GNOME Documentation Project, the names have been printed in caps
        or initial caps.
      </para>
    </legalnotice>
  </bookinfo>

  <part id="part_begin">
    <title>Getting started</title>
    <chapter id="introduction">
      <title>Introduction</title>
      <para>
	&ODBC; and &SQL; are established standards. The problem is, that &ODBC;
	doesn't specify the wire protocol and for some databases no &ODBC; driver
	exists. You might use <acronym>RPC</acronym>, <acronym>TCP/IP</acronym>,
	or shared memory and signals to pass the request from the client to the
	server. So you have to use the database specific &ODBC; library. This 
	library might not be available for the <acronym>CPU</acronym> or 
	operating system on which the client is running. 
      </para>
      <para>
	&SQL; itself is also not standardised enough, so that source
	compatibility can not be assured for all database servers. And for some
	sort of servers, &SQL; is not even feasible (think about &LDAP;).
      </para>
      <para>
	&GDA; tries to tackle the &ODBC; problem and help you with the &SQL;
	problem. It's a sort of middleware (or can be blown up to be a middleware
	layer) to access different data sources. It offers a high level view of
	data sources and has some places where you can plug in low level access
	to the database for special tasks.
      </para>
      <para>
	GNOME Data Access (&GDA;) is defined as a set of plug-in interfaces.
	The level of abstraction provided by &GDA; makes it possible to access
	any kind of data source, provided that a plug-in implementing 
	those interfaces and accessing this particular data source is
	written.
      </para>
      <para>
	It offers a wrapper around the database internals, thus making it easier
	for programmers to make use of all the power provided by many RDBMS without
	even knowing about it. It comes along with a library, for both
	clients and servers, as a C implementation of this architecture. This level of
	abstraction would make possible to, at a later time, change all the
	internals without having to modify applications using the libraries.
      </para>
      <para>
	Along with these libraries (and associated header files and language 
	bindings for development), &LIBGDA; includes several tools and utilities
	to help you with the task of developing applications based on &LIBGDA;,
	as well as for automating some database-related tasks.
      </para>
      <para>
	&LIBGDA; is implemented for <systemitem class="osname">UNIX
	</systemitem>-like operating systems (including <systemitem 
							   class="osname">Linux</systemitem>), and does not depend on other 
	libraries apart from  <systemitem class="resource">libxml2</systemitem> and 
	<systemitem class="resource">Glib</systemitem>, which makes it a very
	lightweight system also ideal for applications to be run on 
	hardware-limited systems. It was once part of the &GNOMEDB; project, and
	is still used as the basis for it, but it's been separated from it to
	remove all GNOME dependencies and thus allow non-GNOME applications to
	be developed based on it.
      </para>
    </chapter>
    
    <chapter id="architecture">
      <title>&LIBGDA; architecture</title>
      <para>
	&LIBGDA; is composed of three independent layers. The lower level is
	covered by the &GDA; providers, which are plug-ins whose task is
	to map the <acronym>RDBMS</acronym>-specific &API; to the &GDA; model.
	That is, they are objects implementing the &GDA; interfaces.
      </para>
      <para>
	Then, in a middle layer, are the client libraries: an easy-to-use and
	full featured library which offers access to all the architecture,
	also including several utility functions to help you on the development
	of applications based on &GDA;. This library, although targeted to client
	applications, also includes a set of helper classes and functions to help
	in the addition of new providers to the &LIBGDA; architecture.
      </para>
      <para>
	Finally, at the upper level sit all the client applications provided in
	the suite, as well as any application that may make use of the client
	libraries.
      </para>
    </chapter>

    &install;
    &examples;
    &migration;
  </part>  
  <part id="part_libgda_api">
    <title>Client API Reference</title>
    <para>
      The following sections describe the API available for &GDA; applications.
    </para>

    <chapter>
      <title>Object Hierarchy</title>
      &libgda-TreeIndex;
    </chapter>

    <chapter id="init_config">
      <title>Initialization and configuration</title>
      &libgda-init;
      &libgda-config;
    </chapter>

    <chapter id="connection">
      <title>Connections &amp; commands</title>
      &libgda-GdaClient;
      &libgda-GdaConnection;
      &libgda-GdaConnection-event;
      &libgda-GdaCommand;
    </chapter>

    <chapter id="data_models">
      <title>Data handling</title>
      <para>
	&LIBGDA; being a data oriented library, data handling is a central point of the library. 
	Data handling is about:
	<itemizedlist>
	  <listitem>
            <para>individual values: they are encapsulated within a <link linkend="GdaValue">GdaValue</link> 
	      container (which is not much more than a <link linkend="GValue">GValue</link> from GLIB)</para>
	  </listitem>
	  <listitem>
            <para>parameters which are each a specification for a value: a type, a name, a description,
	      a default value, etc. Parameters are encapsulated within a 
	      <link linkend="GdaParameter">GdaParameter</link> container.</para>
	    <para>
	      Note that it is possible to set a hint on parameters to make them have a value which is
	      among the values contained in a column of a <link linkend="GdaDataModel">GdaDataModel</link>.
	    </para>
	  </listitem>
	  <listitem>
            <para>lists of parameters which are encapsulated within a 
	      <link linkend="GdaParameterList">GdaParameterList</link> container.</para>
	    <para>
	      The GdaParameterList object also makes some computations to group parameters which are
	      constrained by values in the same GdaDataModel to make it easy to use parameters
	      which are not really independant.
	    </para>
	  </listitem>
	  <listitem>
            <para>arrays of values organized in rows and columns. All the data in the same 
	      column have the same type, and all the data in each row have the same semantic meaning. 
	      &LIBGDA; uses the <link linkend="GdaDataModel">GdaDataModel</link> 
	      objects to actually hold the data (note that this is actually an interface which has 
	      sevaral implementations depending on the real data organization in the data model).</para>
	    <para>Note that depending on the real implementation, access to the data can be random or
	    done using an iterator, and that the data model can be read-only or modifiable.</para>
	  </listitem>
	  <listitem>
            <para>The <link linkend="GdaDataModelIter">GdaDataModelIter</link> object is used to 
	      iterate through the rows of a <link linkend="GdaDataModel">GdaDataModel</link>.</para>
	  </listitem>
	</itemizedlist>
      </para>
      &libgda-GdaValue;
      &libgda-GdaParameter;
      &libgda-GdaParameterList;
      &libgda-GdaDataModel;
      &libgda-GdaColumn;
      &libgda-GdaDataModelIter;
      &libgda-GdaDataModelImport;
      &libgda-GdaDataAccessWrapper;
      &libgda-GdaDataModelArray;
      &libgda-GdaDataModelHash;
      &libgda-GdaDataModelQuery;
      &libgda-GdaDataModelFilterSQL;
      &libgda-GdaDataProxy;
      &libgda-GdaDataModelIndex;
      &libgda-GdaColumnIndex;
    </chapter>

    <chapter>
      <title>Dictionary and related objects</title>
      &libgda-GdaDict;
      &libgda-GdaDictType;
      &libgda-GdaDictFunction;
      &libgda-GdaDictAggregate;
      <para>
	These objects make the in-memory representation of a database structure (Tables, fields, ...),
	they are part of the data dictionary (see <link linkend="GdaDict">GdaDict</link>).
	Related interfaces are:  
	<link linkend="GdaXmlStorage">GdaXmlStorage</link>, 
	<link linkend="GdaEntity">GdaEntity</link>,
	<link linkend="GdaEntityField">GdaEntityField</link>, 
	<link linkend="GdaRenderer">GdaRenderer</link> and 
	<link linkend="GdaReferer">GdaReferer</link>.
      </para>
      &libgda-GdaDictDatabase;
      &libgda-GdaDictTable;
      &libgda-GdaDictField;
      &libgda-GdaDictConstraint;
    </chapter>

    <chapter>
      <title>Data manipulation (DML) queries</title>
      &libgda-query-intro;
      &libgda-query-fields;
      &libgda-GdaQuery;
      &libgda-GdaQueryTarget;
      &libgda-GdaQueryJoin;
      &libgda-GdaQueryFieldAll;
      &libgda-GdaQueryFieldField;
      &libgda-GdaQueryFieldFunc;
      &libgda-GdaQueryFieldAgg;
      &libgda-GdaQueryFieldValue;
      &libgda-GdaQueryCondition;
    </chapter>

    <chapter id="misc">
      <title>Miscellaneous</title>
      &libgda-util;
      &libgda-log;
      &libgda-quark-list;
      &libgda-transaction;
      &libgda-GdaBlob;
      &libgda-GdaObject;
      &libgda-GdaObjectRef;
      &libgda-GdaGraphviz;
      &libgda-GdaDataModelRow;
      &libgda-GdaQueryField;
      &libgda-GdaQueryObject;
      &libgda-GdaThreader;
    </chapter>

    <chapter>
      <title>Graphs</title>
      &libgda-GdaGraph;
      &libgda-GdaGraphQuery;
      &libgda-GdaGraphItem;
    </chapter>
    <chapter>
      <title>List of lesser used interfaces</title>
      &libgda-GdaEntity;
      &libgda-GdaEntityField;
      &libgda-GdaXmlStorage;
      &libgda-GdaRenderer;
      &libgda-GdaReferer;
    </chapter>
  </part>

  <part id="part_tools">
    <title>&GDA; Tools</title>
    <chapter id="libgda-tools-introduction">
      <title>Introduction</title>
      <para>
	&LIBGDA; offers several command line tools to help disgnose and resolve problems. All the
	provided tools can be run with the "--help" command line argument to give an online help
	and description.
      </para>
    </chapter>

    <chapter id="libgda-tools-list-config">
      <title>gda-list-config</title>
      <para>
	The gda-list-config tool simply lists all the declared data sources, and all the installed
	providers, giving some other usefull information as well for each.
      </para>
    </chapter>

    <chapter id="libgda-tools-diagnose">
      <title>gda-diagnose</title>
      <para>
	The gda-diagnose tool is a quite exhaustive and verbose testing program which output 
	several HTML files
	in a specified directory (DIAGNOSE_OUTPUT by default). It can either test a single data source
	or all the data sources if none is specified. Running this tool can be time consuming...
      </para>
      <para>
	The tool tests:
	<itemizedlist>
	  <listitem>
            <para>Data sources (or one if one is provided): </para>
	  </listitem>
	  <listitem>
            <para>All the installed providers when connection is provided</para>
	  </listitem>
	</itemizedlist>
      </para>
    </chapter>

    <chapter id="libgda-tools-author-dict">
      <title>gda-author-dict-file</title>
      <para>
	The gda-author-dict-file tool allows to create a XML dictionary file which can be loaded into a 
	#GdaDict object, specifying a data source to use. Specifically it does (depending on command line
	options):
	<itemizedlist>
	  <listitem>
            <para>reports errors if the XML file already exists can't be loaded</para>
	  </listitem>
	  <listitem>
            <para>synchronizes the contents of the dictionary with a data source</para>
	  </listitem>
	</itemizedlist>

      </para>
    </chapter>

    <chapter id="libgda-tools-inspect-dict">
      <title>gda-inspect-dict-file</title>
      <para>
	The gda-inspect-dict-file tool tests an existing XML dictionary file and (depending on command line
	options):
	<itemizedlist>
	  <listitem>
            <para>reports errors if the file can't be loaded or if saving it back produces a different file</para>
	  </listitem>
	  <listitem>
            <para>lists all the pre-defined queries and creates .dot files for each of them</para>
	  </listitem>
	</itemizedlist>
      </para>
    </chapter>
  </part>

  <part id="part_providers">
    <title>Databases access providers</title>
    <chapter id="libgda-provider-introduction">
      <title>Introduction</title>
      <para>
	For each different data source supported by &LIBGDA; there must be a
	GObject that implements the virtual methods defined in &GDASERVERPROVIDER;
	class.
      </para>
      <para>
	Providers must also create their own object to implement the virtual
	methods defined in &GDADATAMODEL; or one of
	its subclasses (currently &GDADATAMODELARRAY; and &GDADATAMODELHASH;) 
	to support recordsets.
      </para>
      <para>
	Since &LIBGDA; itself is developed in the C language, and that most
	providers are also implemented in that language, the &LIBGDA; library
	itself contains a set of helper classes and functions to guide you
	in the addition of a new provider to the GDA framework.
      </para>
    </chapter>

    <chapter id="libgda-provider-class">
      <title>Virtual methods for providers</title>
      <para>
	The &GDASERVERPROVIDER; is the class you should implement for adding
	a new provider. This class is just a typical GObject-based class,
	with a set of virtual methods, that are the ones that you must
	implement. These virtual methods are declared in the class structure,
	in the <filename>gda-server-provider.h</filename> file. They are
	explained in detail in the following subsections.
      </para>
      <sect1 id="libgda-provider-open-connection">
	<title>open_connection</title>
	<para>
	  Sets up the connection to the database back-end using the parameters
	  received as arguments and returns a boolean TRUE if the connection
	  is successfully established, otherwise FALSE.
	</para>
      </sect1>
      <sect1 id="libgda-provider-close-connection">
	<title>close_connection</title>
	<para>
	  Frees the resources allocated for the connection and returns TRUE
	  if everything is ok
	</para>
      </sect1>
      <sect1 id="libgda-provider-get-database">
	<title>get_database</title>
	<para>
	  Returns the name of the currently open database for a given
	  connection.
	</para>
      </sect1>
      <sect1 id="libgda-provider-change-database">
	<title>change_database</title>
	<para>
	  Change the database being used in the active connection.
	</para>
      </sect1>
      <sect1 id="libgda-provider-get-specs">
	<title>get_specs</title>
	<para>
	  Returns the parameters which would be required to perform a specific
	  action (such as create a database)
	</para>
      </sect1>
      <sect1 id="libgda-provider-perform-action-params">
	<title>perform_action_params</title>
	<para>
	  Actually perform an action (such as create a database) using parameters
	  for which a list has been obtained using the get_specs() virtual method.
	</para>
      </sect1>
      <sect1 id="libgda-provider-create-database-cnc">
	<title>create_database_cnc</title>
	<para>
	  Creates a new database whose name is received in a parameter.	
	</para>
      </sect1>
      <sect1 id="libgda-provider-drop-database-cnc">
	<title>drop_database_cnc</title>
	<para>
	  Drops an existing database whose name is received in a parameter.
	</para>
      </sect1>
      <sect1 id="libgda-provider-execute-command">
	<title>execute_command</title>
	<para>
	  Executes a command and returns a GList of &GDADATAMODEL; with the
	  results.
	</para>
      </sect1>
      <sect1 id="libgda-provider-begin-transaction">
	<title>begin_transaction</title>
	<para>
	  Initiates a transaction if the DB back-end supports transactions.
	</para>
      </sect1>
      <sect1 id="libgda-provider-commit-transaction">
	<title>commit_transaction</title>
	<para>
	  Commits a transaction if the DB back-end supports transactions.
	</para>
      </sect1>
      <sect1 id="libgda-provider-rollback-transaction">
	<title>rollback_transaction</title>
	<para>
	  Rollback a transaction if the DB back-end supports transactions.
	</para>
      </sect1>
      <sect1 id="libgda-provider-supports">
	<title>supports</title>
	<para>
	  Tests if a given feature is supported by the provider and the
	  DB back-end. You can view the list of features in <filename>
	    gda-connection.h</filename>, enumeration GdaConnectionFeature.
	</para>
      </sect1>
      <sect1 id="libgda-provider-get-schema">
	<title>get_schema</title>
	<para>
	  Returns a &GDADATAMODEL; with the schema information requested.
	  You can view the list of features in <filename>
	    gda-connection.h</filename>, enumeration GdaConnectionSchema.
	  This schema information is what describes the objects in the
	  database, and is the way applications can manage the structure
	  of several database systems without knowing anything about
	  their specific way of retrieving this information.
	</para>
	<para>
	  The <function>get_schema</function> virtual method gets a
	  <type>GdaConnectionSchema</type> argument, which describes
	  the kind of schema the client making the call is interested
	  in, along with a <type>GdaParameterList</type> argument,
	  which contains the list of arguments sent by the user to
	  explicitly provide more information for the search.
	</para>
	<para>
	  The information to be returned for each schema, along with
	  the supported parameters, is described in the following table.
	</para>
	<table frame="all">
	  <title>Standard Schema and supported parameters</title>
	  <tgroup cols="4" colsep="1" rowsep="1" align="justify">
	    <colspec colname="c1"/>
	    <colspec colname="c2"/>
	    <colspec colname="c3"/>
	    <colspec colname="c4"/>
	    <thead>
	      <row>
		<entry>Object type</entry>
		<entry>GDA identifier</entry>
		<entry>Supported Parameters</entry>
		<entry>Returned fields</entry>
	      </row>
	    </thead>
	    <tbody>
	      <row>
		<entry>Databases</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_DATABASES</parameter></entry>
		<entry></entry>
		<entry>name</entry>
	      </row>
	      <row>
		<entry>Schemas (also namespaces), a feature supported by Postgres which allows to
                  define multiple domains within a single database</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_NAMESPACES</parameter></entry>
		<entry></entry>
		<entry>name</entry>
	      </row>
	      <row>
		<entry>Tables</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_TABLES</parameter></entry>
		<entry>"name" (name of table, optional)</entry>
		<entry>name, owner, comments, SQL definition</entry>
	      </row>
	      <row>
		<entry>Tables' parents</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_PARENT_TABLES</parameter></entry>
		<entry>"name" (name of table, optional)</entry>
		<entry>name, order of inheritance</entry>
	      </row>
	      <row>
		<entry>Views</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_VIEWS</parameter></entry>
		<entry>"name" (name of view, optional)</entry>
		<entry>name, owner, comments, SQL definition</entry>
	      </row>
	      <row>
		<entry>Table (or view) fields</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_FIELDS</parameter></entry>
		<entry>"name" (name of table (or view), required)</entry>
		<entry>name, type, size, scale, not null?, primary key?, unique index?, references, default value, comma separated extra attributes (AUTO_INCREMENT)</entry>
	      </row>
	      <row>
		<entry>Sequences</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_SEQUENCES</parameter></entry>
		<entry>"name" (name of sequence, optional)</entry>
		<entry>name, owner, comments, SQL definition</entry>
	      </row>
	      <row>
		<entry>Procedures</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_PROCEDURES</parameter></entry>
		<entry>"name" (name of procedure, optional)</entry>
		<entry>name, unique id, owner, comments, return type, number of arguments, arguments types 
		  (arguments types in the order, comma separated) and SQL definition.
		  For the arguments where any type is accepted, '-' is returned as type.</entry>
	      </row>
	      <row>
		<entry>Aggregates</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_AGGREGATES</parameter></entry>
		<entry>"name" (name of aggregate, optional)</entry>
		<entry>name, unique id, owner, comments, return type, argument type, SQL definition.
		  If the argument can be of any type, then '-' is returned as type.</entry>
	      </row>
	      <row>
		<entry>Types</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_TYPES</parameter></entry>
		<entry>"name" (name of type, optional)</entry>
		<entry>name, owner, comments, GDA type, synonyms (comma separated)</entry>
	      </row>
	      <row>
		<entry>Tables' constraints</entry>
		<entry><parameter>GDA_CONNECTION_SCHEMA_CONSTRAINTS</parameter></entry>
		<entry>"name" (name of table)</entry>
		<entry>constraint name, constraint type (FOREIGN_KEY, PRIMARY_KEY, UNIQUE, CHECK), on fields (comma separated), 
		  definition, options (ON_UPDATE_*, ON_DELETE_*, DEFERRABLE, INITIALLY_DEFERRED)</entry>
	      </row>
	    </tbody>
	  </tgroup>
	</table>
      </sect1>
    </chapter>

    <chapter id="libgda-provider-recordset">
      <title>Virtual methods for recordsets</title>
      <para>
	You have to extend one of &GDADATAMODEL;, &GDADATAMODELARRAY; or
	&GDADATAMODELHASH;. The easiest to extend are the last two. They both
	derive from &GDADATAMODEL;.
      </para>
      <para>
	Here is the list of methods that you have to override. If you use
	&GDADATAMODELHASH;, you don't need to override 
	append_row.
      </para>
      <itemizedlist>
	<listitem>
	  <para>get_n_rows</para>
	  <para>
	    Returns the number of rows in the data model. If the provider
	    can know in advance the number of rows the database server has
	    returned, this function should just return that, and not
	    retrieve any data. On the other hand, if it can't it should
	    either retrieve all data, or move to the last record in the
	    recordset and retrieve the row number, if the underlying
	    data source allows it.
	  </para>
	</listitem>
	<listitem>
	  <para>get_n_columns</para>
	  <para>
	    Returns the number of columns in the data model.
	  </para>
	</listitem>
	<listitem>
	  <para>describe_column</para>
	  <para>
	    Returns information about a given column, in the form of
	    a <link linkend="GdaColumn">GdaColumn</link>.
	  </para>
	</listitem>
	<listitem>
	  <para>get_row</para>
	  <para>
	    Retrieves a row from the data model. This function is very important
	    for the implementation of editable data models. What this function
	    returns is a <link linkend="GdaRow">GdaRow</link>, which providers
	    should uniquely identify (via <link linkend="gda-row-set-id">gda_row_set_id</link>).
	    This is needed so that later on, client applications can use the same
	    <link linkend="GdaRow">GdaRow</link> returned by this method in
	    the <function>update_row</function> and <function>remove_row</function>
	    methods.
	  </para>
	</listitem>
	<listitem>
	  <para>get_value_at</para>
	  <para>
	    Returns the value stored in a given cell of the data model.
	  </para>
	</listitem>
	<listitem>
	  <para>is_editable</para>
	  <para>
	    Checks whether the data model can be modified or not. If the provider
	    supports the edition of data models, it should return TRUE in this
	    function. If it doesn't (for instance, because it can't uniquely identify
	    rows in the data model), it should return FALSE.
	  </para>
	  <para>
	    Before a data model can be edited, client applications must call the
	    <link linkend="gda-data-model-begin-edit">gda_data_model_begin_edit</link>
	    function, which emits the "begin_edit" signal on the
	    <link linkend="GdaDataModel">GdaDataModel</link> class. So, providers
	    should connect to this signal to be informed when the data model
	    starts being editing. In the callback connected to that signal,
	    it should start a transaction, for instance.
	  </para>
	  <para>
	    In a similar way, there are 2 other signals that provider's data model
	    implementations should pay attention to. Those are "end_edit" and
	    "cancel_edit". In "end_edit", if all went ok, providers should
	    COMMIT the transaction started in "begin_edit". In "cancel_edit",
	    a ROLLBACK should be made.
	  </para>
	</listitem>
	<listitem>
	  <para>append_row</para>
	  <para>
	    Appends a row to the data model. Usually, this means, in the provider,
	    executing an INSERT SQL command on the table being read by the
	    data model.
	  </para>
	</listitem>
	<listitem>
	  <para>update_row</para>
	  <para>
	    Updates an existing row in the data model. The row should have been
	    uniquely identified in the provider code, as explained for the
	    get_row method.
	  </para>
	</listitem>
	<listitem>
	  <para>remove_row</para>
	  <para>
	    Removes a row from the data model. Usually, this means, in the provider,
	    executing a DELETE SQL command on the table being read by the data model.
	    The row should have been
	    uniquely identified in the provider code, as explained for the
	    get_row method.
	  </para>
	</listitem>
      </itemizedlist>
    </chapter>
    &libgda-GdaServerProvider;
  </part>

  <part id="part_libgda-reports">
    <title>&GDA; Report Engine</title>
    <chapter id="libgda-reports-introduction">
      <title>Introduction</title>
      <para>
	FIXME: place here an introduction about reports
      </para>
    </chapter>

    <chapter id="libgda-reports">
      <title>API reference</title>
      <para>
	&LIBGDA; includes a built-in reporting engine which allows applications to easily
	create, manage and run custom reports.
      </para>
      &libgda-report-types;
      &libgda-report-document;
      &libgda-report-item;
      &libgda-report-item-detail;
      &libgda-report-item-label;
      &libgda-report-item-pagefooter;
      &libgda-report-item-pageheader;
      &libgda-report-item-repfield;
      &libgda-report-item-report;
      &libgda-report-item-reportfooter;
      &libgda-report-item-reportheader;
      &libgda-report-item-sqlquery;
      &libgda-report-result;
      &libgda-report-valid;
    </chapter>
  </part>

  &fdl-appendix;
  <index>
    <title>Index</title>
  </index>
</book>

