libgda r3059 - in branches/V4-branch: . doc/C doc/C/examples doc/C/tmpl libgda libgda-report/engine libgda/sqlite/virtual providers/bdb providers/postgres samples/DDL samples/DirDataModel samples/F-Spot samples/Report samples/SimpleExample samples/TableCopy samples/Virtual samples/XSLT testing tests/data-models tests/providers tools



Author: vivien
Date: Thu Feb 21 17:19:02 2008
New Revision: 3059
URL: http://svn.gnome.org/viewvc/libgda?rev=3059&view=rev

Log:
2008-02-21  Vivien Malerba <malerba gnome-db org>

	* Removed the GdaClient class, connections are now opened using gda_connection_open_from_dsn()
	and gda_connection_open_from_string().
	* libgda/sqlite/virtual/gda-virtual-connection.[ch]: added gda_virtual_connection_open() as
	the only recommended way to create virtual connections
	* libgda/libgda.h.in:
	* libgda/gda-init.c:
	* libgda/gda-easy.[ch]: moved to convenience functions to new files
	* libgda/gda-server-provider.[ch]: removed gda_server_provider_create_connection(),
	gda_server_provider_create_connection_from_string(), gda_server_provider_open_connection(),
	gda_server_provider_close_connection(), gda_server_provider_get_database(),
	gda_server_provider_begin_transaction(), gda_server_provider_commit_transaction(),
	gda_server_provider_rollback_transaction(), gda_server_provider_add_savepoint(),
	gda_server_provider_rollback_savepoint() and gda_server_provider_delete_savepoint()
	because an easier API is available
	* tools/gda-sql.c:
	* tools/command-exec.[ch]: improved tables and views listing
	* providers/postgres/gda-postgres-ddl.c:
	* providers/postgres/postgres_specs_create_table.xml.in: partially applied patch by Daniel
	Espinosa for bug #515306
	* providers/postgres/gda-postgres-meta.c:
	* providers/postgres/gda-postgres-provider.c: more work
	* doc/C: doc. update


Added:
   branches/V4-branch/libgda/gda-easy.c
   branches/V4-branch/libgda/gda-easy.h
Removed:
   branches/V4-branch/doc/C/tmpl/gda-client.sgml
   branches/V4-branch/libgda/gda-client-private.h
   branches/V4-branch/libgda/gda-client.c
   branches/V4-branch/libgda/gda-client.h
Modified:
   branches/V4-branch/ChangeLog
   branches/V4-branch/doc/C/examples/full_example.c
   branches/V4-branch/doc/C/gettingstarted.xml
   branches/V4-branch/doc/C/libgda-4.0-docs.sgml
   branches/V4-branch/doc/C/libgda-4.0-sections.txt
   branches/V4-branch/doc/C/libgda-4.0.types.in
   branches/V4-branch/doc/C/migration2.xml
   branches/V4-branch/doc/C/tmpl/gda-connection.sgml
   branches/V4-branch/doc/C/tmpl/gda-convenient.sgml
   branches/V4-branch/doc/C/tmpl/gda-meta-store.sgml
   branches/V4-branch/doc/C/tmpl/gda-server-provider.sgml
   branches/V4-branch/doc/C/tmpl/gda-virtual-connection.sgml
   branches/V4-branch/doc/C/virtual.xml
   branches/V4-branch/libgda-report/engine/gda-report-engine.c
   branches/V4-branch/libgda/Makefile.am
   branches/V4-branch/libgda/gda-connection.c
   branches/V4-branch/libgda/gda-connection.h
   branches/V4-branch/libgda/gda-data-proxy.c
   branches/V4-branch/libgda/gda-init.c
   branches/V4-branch/libgda/gda-meta-store.c
   branches/V4-branch/libgda/gda-meta-store.h
   branches/V4-branch/libgda/gda-server-provider.c
   branches/V4-branch/libgda/gda-server-provider.h
   branches/V4-branch/libgda/libgda.h.in
   branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.c
   branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.h
   branches/V4-branch/libgda/sqlite/virtual/virtual-test.c
   branches/V4-branch/providers/bdb/gda-bdb-test.c
   branches/V4-branch/providers/postgres/gda-postgres-ddl.c
   branches/V4-branch/providers/postgres/gda-postgres-meta.c
   branches/V4-branch/providers/postgres/gda-postgres-provider.c
   branches/V4-branch/providers/postgres/postgres_specs_create_table.xml.in
   branches/V4-branch/samples/DDL/ddl.c
   branches/V4-branch/samples/DirDataModel/find-duplicates.c
   branches/V4-branch/samples/F-Spot/repair-path.c
   branches/V4-branch/samples/Report/customers-report-docbook.c
   branches/V4-branch/samples/Report/customers-report-rml.c
   branches/V4-branch/samples/Report/customers-report.c
   branches/V4-branch/samples/SimpleExample/example.c
   branches/V4-branch/samples/TableCopy/common.c
   branches/V4-branch/samples/TableCopy/common.h
   branches/V4-branch/samples/TableCopy/table-copy-easier.c
   branches/V4-branch/samples/TableCopy/table-copy.c
   branches/V4-branch/samples/Virtual/virtual-test.c
   branches/V4-branch/samples/XSLT/transform.c
   branches/V4-branch/testing/gda-test-blob.c
   branches/V4-branch/testing/gda-test-connection.c
   branches/V4-branch/tests/data-models/check_virtual.c
   branches/V4-branch/tests/providers/prov-test-util.c
   branches/V4-branch/tools/command-exec.c
   branches/V4-branch/tools/command-exec.h
   branches/V4-branch/tools/gda-sql.c

Modified: branches/V4-branch/doc/C/examples/full_example.c
==============================================================================
--- branches/V4-branch/doc/C/examples/full_example.c	(original)
+++ branches/V4-branch/doc/C/examples/full_example.c	Thu Feb 21 17:19:02 2008
@@ -1,7 +1,7 @@
 <![CDATA[#include <libgda/libgda.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 void display_products_contents (GdaConnection *cnc);
 void create_table (GdaConnection *cnc);
 void run_sql_non_select (GdaConnection *cnc, const gchar *sql);
@@ -11,14 +11,10 @@
 {
         gda_init ("SimpleExample", "1.0", argc, argv);
 
-        GdaClient *client;
         GdaConnection *cnc;
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open connections */
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	create_table (cnc);
 	display_products_contents (cnc);
         gda_connection_close (cnc);
@@ -30,16 +26,16 @@
  * Open a connection to the example.db file
  */
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection (void)
 {
         GdaConnection *cnc;
         GError *error = NULL;
 	GdaSqlParser *parser;
 
 	/* open connection */
-        cnc = gda_client_open_connection_from_string (client, "SQLite", "DB_DIR=.;DB_NAME=example_db", NULL, NULL,
-						      GDA_CONNECTION_OPTIONS_DONT_SHARE,
-						      &error);
+        cnc = gda_connection_open_from_string ("SQLite", "DB_DIR=.;DB_NAME=example_db", NULL, NULL,
+					       GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					       &error);
         if (!cnc) {
                 g_print ("Could not open connection to SQLite database in example_db.db file: %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/doc/C/gettingstarted.xml
==============================================================================
--- branches/V4-branch/doc/C/gettingstarted.xml	(original)
+++ branches/V4-branch/doc/C/gettingstarted.xml	Thu Feb 21 17:19:02 2008
@@ -20,14 +20,11 @@
 void
 do_stuff () 
 {
-	GdaClient *client;
 	GdaConnection *connection;
       
         /* open a connection */
-	client = gda_client_new ();      
 	g_print ("CONNECTING\n");
-	connection = gda_client_open_connection (client, "calvaris", NULL, NULL,
-						 GDA_CONNECTION_OPTIONS_READ_ONLY);
+	connection = gda_connection_open_from_dsn ("calvaris", NULL, NULL, GDA_CONNECTION_OPTIONS_READ_ONLY);
 	g_print ("CONNECTED\n");
       
         /* use the connection */
@@ -35,7 +32,6 @@
       
         /* close the connection */
         g_object_unref (G_OBJECT (connection));
-	g_object_unref (G_OBJECT (client));
 }
       
       
@@ -61,28 +57,21 @@
       required information to actually open a connection (except the name and password if they are required). Of
       course it's still possible to open a connection without having defined a DSN, in which case a <emphasis>connection
       string</emphasis> is used to specify all the parameters resuired to open a connection. For more information
-      about connection strings, see the <link linkend="gda-client-open-connection-from-string">gda_client_open_connection_from_string ()</link>'s documentation.
+      about connection strings, see the <link linkend="gda-connection-open-from-string">gda_connection_open_from_string ()</link>'s documentation.
     </para>
     <para>
-      Connections are created by a <link linkend="GdaClient">GdaClient</link> object which can also manage connection pools.
-      So the first step is to create a GdaClient object using 
-      <link linkend="gda-client-new">gda_client_new ()</link>, and then use
-      <link linkend="gda-client-open-connection">gda_client_open_connection ()</link> (or 
-      <link linkend="gda-client-open-connection-from-string">gda_client_open_connection_from_string ()</link>
-      for connections not defined as DSN)
-      to create connection objects (<link linkend="GdaConnection">GdaConnection</link> objects). Each connection object
-      can then be used to actually execute queries, for example:
+      Connections are opened using <link linkend="gda-connection-open-from-dsn">gda_connection_open_from_dsn ()</link> for
+      connections which are defined as a data source (DSN), or
+      or <link linkend="gda-connection-open-from-string">gda_connection_open_from_string ()</link> otherwise. 
+      Each connection object can then be used to actually execute queries, for example:
       <programlisting>
 void
 do_stuff () {
-	GdaClient *client;
 	GdaConnection *connection;
       
         /* open a connection */
-	client = gda_client_new ();      
 	g_print ("CONNECTING\n");
-	connection = gda_client_open_connection (client, "calvaris", NULL, NULL,
-						 GDA_CONNECTION_OPTIONS_READ_ONLY);
+	connection = gda_connection_open_from_dsn ("calvaris", NULL, NULL, GDA_CONNECTION_OPTIONS_READ_ONLY);
 	g_print ("CONNECTED\n");
       
         /* use the connection */
@@ -90,7 +79,6 @@
       
         /* close the connection */
         g_object_unref (G_OBJECT (connection));
-	g_object_unref (G_OBJECT (client));
 }
       </programlisting>
     </para>

Modified: branches/V4-branch/doc/C/libgda-4.0-docs.sgml
==============================================================================
--- branches/V4-branch/doc/C/libgda-4.0-docs.sgml	(original)
+++ branches/V4-branch/doc/C/libgda-4.0-docs.sgml	Thu Feb 21 17:19:02 2008
@@ -39,7 +39,6 @@
 <!ENTITY migration SYSTEM "migration.xml">
 <!ENTITY migration2 SYSTEM "migration2.xml">
 <!ENTITY limitations SYSTEM "limitations.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">
@@ -127,15 +126,6 @@
           <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>
-	<contrib>Current maintainer
-        </contrib>
-      </author>
       <author role="clean up">
 	<firstname>Sean</firstname>
 	<surname>Allen</surname>
@@ -175,6 +165,25 @@
 	<contrib>libgda, gda-postgres, gda-mysql
         </contrib>
       </author>
+      <author>
+        <firstname>Daniel</firstname>
+        <surname>Espinosa Ortiz</surname>
+        <affiliation>
+          <orgname></orgname>
+          <address><email>esodan gmail com</email></address>
+        </affiliation>
+	<contrib>libgda, gda-postgres, gda-mysql
+        </contrib>
+      </author>
+      <author>
+        <firstname>Vivien</firstname>
+        <surname>Malerba</surname>
+        <affiliation>
+          <address><email>malerba gnome-db org</email></address>
+        </affiliation>
+	<contrib>Current maintainer
+        </contrib>
+      </author>
     </authorgroup>
     <date>2008</date>
     <copyright>
@@ -468,9 +477,7 @@
     <chapter id="connection">
       <title>Connections &amp; commands</title>
       <para>
-	The &LIBGDA; library allows several connections to databases to be opened at once, all managed through a 
-	<link linkend="GdaClient">GdaClient</link> object (for
-	some special purposes, several <link linkend="GdaClient">GdaClient</link> objects can be used at once).
+	The &LIBGDA; library allows several connections to databases to be opened at once.
 	Once a connection (manipulated through the <link linkend="GdaConnection">GdaConnection</link> object)
 	has been created and is opened, it is able to proceed <link linkend="GdaStatement">GdaStatement</link> statements.
       </para>
@@ -490,7 +497,7 @@
 	&LIBGDA; library allows one to use either a generic SQL parser, or a parser provided by each database adaptator (database
 	provider), through the <link linkend="gda-connection-create-parser">gda_connection_create_parser()</link> method.
       </para>
-      &libgda-GdaClient;
+      &libgda-convenient;
       &libgda-GdaConnection;
       &libgda-GdaSqlParser;
       &libgda-GdaStatement;
@@ -500,7 +507,6 @@
       &libgda-GdaSqlStatement;
       &libgda-GdaConnection-event;
       &libgda-transaction-status;
-      &libgda-convenient;
       &GdaStoreMetaType;
     </chapter>
 

Modified: branches/V4-branch/doc/C/libgda-4.0-sections.txt
==============================================================================
--- branches/V4-branch/doc/C/libgda-4.0-sections.txt	(original)
+++ branches/V4-branch/doc/C/libgda-4.0-sections.txt	Thu Feb 21 17:19:02 2008
@@ -1,29 +1,4 @@
 <SECTION>
-<FILE>gda-client</FILE>
-<TITLE>GdaClient</TITLE>
-GdaClient
-GdaClientError
-GdaClientEvent
-gda_client_new
-gda_client_open_connection
-gda_client_open_connection_from_string
-gda_client_get_connections
-<SUBSECTION>
-gda_client_prepare_create_database
-gda_client_perform_create_database
-gda_client_prepare_drop_database
-gda_client_perform_drop_database
-<SUBSECTION Standard>
-GDA_CLIENT
-GDA_CLIENT_CLASS
-GDA_CLIENT_ERROR
-GDA_IS_CLIENT
-GDA_IS_CLIENT_CLASS
-GDA_TYPE_CLIENT
-gda_client_get_type
-</SECTION>
-
-<SECTION>
 <FILE>gda-column-index</FILE>
 <TITLE>GdaColumnIndex</TITLE>
 GdaColumnIndex
@@ -162,6 +137,8 @@
 <TITLE>GdaConnection</TITLE>
 GdaConnection
 GdaConnectionOptions
+gda_connection_open_from_dsn
+gda_connection_open_from_string
 gda_connection_open
 gda_connection_close
 gda_connection_close_no_warning
@@ -183,7 +160,6 @@
 gda_connection_delete_savepoint
 <SUBSECTION>
 gda_connection_get_transaction_status
-gda_connection_get_client
 gda_connection_get_options
 gda_connection_get_provider_obj
 gda_connection_get_provider_name
@@ -619,21 +595,12 @@
 gda_server_provider_get_name
 gda_server_provider_get_version
 gda_server_provider_get_server_version
-gda_server_provider_open_connection
-gda_server_provider_reset_connection
-gda_server_provider_close_connection
 gda_server_provider_get_database
 gda_server_provider_supports_operation
 gda_server_provider_create_operation
 gda_server_provider_render_operation
 gda_server_provider_perform_operation
 gda_server_provider_create_parser
-gda_server_provider_begin_transaction
-gda_server_provider_commit_transaction
-gda_server_provider_rollback_transaction
-gda_server_provider_add_savepoint
-gda_server_provider_rollback_savepoint
-gda_server_provider_delete_savepoint
 gda_server_provider_supports_feature
 gda_server_provider_get_data_handler_gtype
 gda_server_provider_get_data_handler_dbms
@@ -696,6 +663,8 @@
 <FILE>gda-virtual-connection</FILE>
 <TITLE>GdaVirtualConnection</TITLE>
 GdaVirtualConnection
+gda_virtual_connection_open
+<SUBSECTION>
 gda_virtual_connection_internal_set_provider_data
 gda_virtual_connection_internal_get_provider_data
 <SUBSECTION Standard>
@@ -1008,17 +977,24 @@
 <SECTION>
 <FILE>gda-convenient</FILE>
 <TITLE>Convenient functions</TITLE>
-gda_open_connection
+gda_prepare_create_database
+gda_perform_create_database
+gda_prepare_drop_database
+gda_perform_drop_database
+<SUBSECTION>
 gda_execute_select_command
-gda_execute_sql_command
+gda_execute_non_select_command
+<SUBSECTION>
 gda_create_table
 gda_drop_table
-gda_get_default_handler
+<SUBSECTION>
 gda_insert_row_into_table
 gda_insert_row_into_table_from_string
 gda_update_value_in_table
 gda_update_values_in_table
 gda_delete_row_from_table
+<SUBSECTION>
+gda_get_default_handler
 </SECTION>
 
 <SECTION>
@@ -1389,6 +1365,7 @@
 gda_meta_store_new_with_file
 gda_meta_store_get_version
 gda_meta_store_get_internal_connection
+gda_meta_store_extract
 gda_meta_store_modify
 <SUBSECTION Standard>
 GDA_IS_META_STORE

Modified: branches/V4-branch/doc/C/libgda-4.0.types.in
==============================================================================
--- branches/V4-branch/doc/C/libgda-4.0.types.in	(original)
+++ branches/V4-branch/doc/C/libgda-4.0.types.in	Thu Feb 21 17:19:02 2008
@@ -7,7 +7,6 @@
 #include <RML/gda-report-rml-document.h>
 #include <DocBook/gda-report-docbook-document.h>
 gda_blob_op_get_type
-gda_client_get_type
 gda_column_get_type
 gda_column_index_get_type
 gda_config_get_type

Modified: branches/V4-branch/doc/C/migration2.xml
==============================================================================
--- branches/V4-branch/doc/C/migration2.xml	(original)
+++ branches/V4-branch/doc/C/migration2.xml	Thu Feb 21 17:19:02 2008
@@ -8,6 +8,8 @@
 	<listitem><para>reduce the size of the library (now 1.1M compared to 1.7M once stripped) and the number of symbols 
 	    (880 compared to 1420) and have less complicated and thus more maintanable code (180 files compared to 250).
 	</para></listitem>
+	<listitem><para>removal of the GdaClient object from which connections were created: this object did not offer
+	    any significant features and made the API more difficult to use</para></listitem>
 	<listitem><para>merge the GdaQuery and GdaCommand into only one object to represent statements</para></listitem>
 	<listitem><para>improve the quantity of information stored in the dictionary and make it easy to include some
 	application-specific data, while at the same time reduce the memory footprint of the dictionary</para></listitem>
@@ -69,6 +71,13 @@
     <sect2><title>API changes</title>
       <para>
 	<itemizedlist>
+	  <listitem><para>Connections are now opened using 
+	      <link linkend="gda-connection-open-from-dsn">gda_connection_open_from_dsn ()</link> or
+	      <link linkend="gda-connection-open-from-string">gda_connection_open_from_string () depending
+		on how the connection is defined</link></para></listitem>
+	  <listitem><para>Upon opening a connection, the <argument>username</argument> and <argument>password</argument>
+	      arguments have heen replaced by a more flexible arguments passing mechanism where providers can specify
+	      what authorization parameters they use</para></listitem>
  	  <listitem><para>gda_server_provider_get_last_insert_id() has been removed in favor of the "last_insert_row" argument
 	  of the <link linkend="gda-connection-statement-execute">gda_connection_statement_execute ()</link> and
 	  <link linkend="gda-connection-statement-execute-non-select">gda_connection_statement_execute_non_select ()</link>
@@ -85,6 +94,7 @@
     <sect2><title>List of removed objects and interfaces</title>
       <para>
 	<itemizedlist>
+ 	  <listitem><para>GdaClient</para></listitem>
  	  <listitem><para>GdaRenderer, GdaXmlStorage, GdaEntity, GdaEntityField and GdaReferer interfaces</para></listitem>
  	  <listitem><para>GdaDict, GdaDictType, GdaDictDatabase, GdaDictTable, GdaDictAggregate, GdaDictField, 
 	      GdaDictConstraint and GdaDictFunction dictionary related objects</para></listitem>

Modified: branches/V4-branch/doc/C/tmpl/gda-connection.sgml
==============================================================================
--- branches/V4-branch/doc/C/tmpl/gda-connection.sgml	(original)
+++ branches/V4-branch/doc/C/tmpl/gda-connection.sgml	Thu Feb 21 17:19:02 2008
@@ -78,11 +78,6 @@
 
 </para>
 
-<!-- ##### ARG GdaConnection:client ##### -->
-<para>
-
-</para>
-
 <!-- ##### ARG GdaConnection:cnc-string ##### -->
 <para>
 
@@ -115,7 +110,31 @@
 
 @GDA_CONNECTION_OPTIONS_NONE: 
 @GDA_CONNECTION_OPTIONS_READ_ONLY: 
- GDA_CONNECTION_OPTIONS_DONT_SHARE: 
+
+<!-- ##### FUNCTION gda_connection_open_from_dsn ##### -->
+<para>
+
+</para>
+
+ dsn: 
+ auth_string: 
+ options: 
+ error: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gda_connection_open_from_string ##### -->
+<para>
+
+</para>
+
+ provider_name: 
+ cnc_string: 
+ auth_string: 
+ options: 
+ error: 
+ Returns: 
+
 
 <!-- ##### FUNCTION gda_connection_open ##### -->
 <para>
@@ -329,15 +348,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_connection_get_client ##### -->
-<para>
-
-</para>
-
- cnc: 
- Returns: 
-
-
 <!-- ##### FUNCTION gda_connection_get_options ##### -->
 <para>
 

Modified: branches/V4-branch/doc/C/tmpl/gda-convenient.sgml
==============================================================================
--- branches/V4-branch/doc/C/tmpl/gda-convenient.sgml	(original)
+++ branches/V4-branch/doc/C/tmpl/gda-convenient.sgml	Thu Feb 21 17:19:02 2008
@@ -17,70 +17,90 @@
 <!-- ##### SECTION Stability_Level ##### -->
 
 
-<!-- ##### FUNCTION gda_open_connection ##### -->
+<!-- ##### FUNCTION gda_prepare_create_database ##### -->
 <para>
 
 </para>
 
- dsn: 
- username: 
- password: 
- options: 
+ provider: 
+ db_name: 
 @error: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_execute_select_command ##### -->
+<!-- ##### FUNCTION gda_perform_create_database ##### -->
 <para>
 
 </para>
 
- cnn: 
- sql: 
+ op: 
+ error: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gda_prepare_drop_database ##### -->
+<para>
+
+</para>
+
+ provider: 
+ db_name: 
 @error: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_execute_sql_command ##### -->
+<!-- ##### FUNCTION gda_perform_drop_database ##### -->
 <para>
 
 </para>
 
- cnn: 
+ op: 
+ error: 
+ Returns: 
+
+
+<!-- ##### FUNCTION gda_execute_select_command ##### -->
+<para>
+
+</para>
+
+ cnc: 
 @sql: 
 @error: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_create_table ##### -->
+<!-- ##### FUNCTION gda_execute_non_select_command ##### -->
 <para>
 
 </para>
 
- cnn: 
- table_name: 
+ cnc: 
+ sql: 
 @error: 
- Varargs: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_drop_table ##### -->
+<!-- ##### FUNCTION gda_create_table ##### -->
 <para>
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @error: 
+ Varargs: 
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_get_default_handler ##### -->
+<!-- ##### FUNCTION gda_drop_table ##### -->
 <para>
 
 </para>
 
- for_type: 
+ cnc: 
+ table_name: 
+ error: 
 @Returns: 
 
 
@@ -89,7 +109,7 @@
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @error: 
 @Varargs: 
@@ -101,7 +121,7 @@
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @error: 
 @Varargs: 
@@ -113,7 +133,7 @@
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @search_for_column: 
 @condition: 
@@ -128,7 +148,7 @@
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @condition_column_name: 
 @condition: 
@@ -142,7 +162,7 @@
 
 </para>
 
- cnn: 
+ cnc: 
 @table_name: 
 @condition_column_name: 
 @condition: 
@@ -150,3 +170,12 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gda_get_default_handler ##### -->
+<para>
+
+</para>
+
+ for_type: 
+ Returns: 
+
+

Modified: branches/V4-branch/doc/C/tmpl/gda-meta-store.sgml
==============================================================================
--- branches/V4-branch/doc/C/tmpl/gda-meta-store.sgml	(original)
+++ branches/V4-branch/doc/C/tmpl/gda-meta-store.sgml	Thu Feb 21 17:19:02 2008
@@ -89,6 +89,7 @@
 @GDA_META_STORE_UNSUPPORTED_PROVIDER: 
 @GDA_META_STORE_INTERNAL_ERROR: 
 @GDA_META_STORE_MODIFY_CONTENTS_ERROR: 
+ GDA_META_STORE_EXTRACT_SQL_ERROR: 
 
 <!-- ##### STRUCT GdaMetaStoreChange ##### -->
 <para>
@@ -154,6 +155,18 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION gda_meta_store_extract ##### -->
+<para>
+
+</para>
+
+ store: 
+ select_sql: 
+ error: 
+ Varargs: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gda_meta_store_modify ##### -->
 <para>
 

Modified: branches/V4-branch/doc/C/tmpl/gda-server-provider.sgml
==============================================================================
--- branches/V4-branch/doc/C/tmpl/gda-server-provider.sgml	(original)
+++ branches/V4-branch/doc/C/tmpl/gda-server-provider.sgml	Thu Feb 21 17:19:02 2008
@@ -138,38 +138,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_server_provider_open_connection ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- params: 
- auth: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_close_connection ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_get_database ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- Returns: 
-
-
 <!-- ##### FUNCTION gda_server_provider_supports_operation ##### -->
 <para>
 
@@ -229,79 +197,6 @@
 @Returns: 
 
 
-<!-- ##### FUNCTION gda_server_provider_begin_transaction ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- level: 
- error: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_commit_transaction ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- error: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_rollback_transaction ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- error: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_add_savepoint ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- error: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_rollback_savepoint ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- error: 
- Returns: 
-
-
-<!-- ##### FUNCTION gda_server_provider_delete_savepoint ##### -->
-<para>
-
-</para>
-
- provider: 
- cnc: 
- name: 
- error: 
- Returns: 
-
-
 <!-- ##### FUNCTION gda_server_provider_supports_feature ##### -->
 <para>
 

Modified: branches/V4-branch/doc/C/tmpl/gda-virtual-connection.sgml
==============================================================================
--- branches/V4-branch/doc/C/tmpl/gda-virtual-connection.sgml	(original)
+++ branches/V4-branch/doc/C/tmpl/gda-virtual-connection.sgml	Thu Feb 21 17:19:02 2008
@@ -23,6 +23,16 @@
 </para>
 
 
+<!-- ##### FUNCTION gda_virtual_connection_open ##### -->
+<para>
+
+</para>
+
+ virtual_provider: 
+ error: 
+ Returns: 
+
+
 <!-- ##### FUNCTION gda_virtual_connection_internal_set_provider_data ##### -->
 <para>
 

Modified: branches/V4-branch/doc/C/virtual.xml
==============================================================================
--- branches/V4-branch/doc/C/virtual.xml	(original)
+++ branches/V4-branch/doc/C/virtual.xml	Thu Feb 21 17:19:02 2008
@@ -12,9 +12,10 @@
   <para>
     A virtual connection is not created in the same way as for a normal connection:
     <itemizedlist>
-      <listitem><para>No <link linkend="GdaClient">GdaClient</link> object is involved</para></listitem>
       <listitem><para>A specific <link linkend="GdaServerProvider">GdaServerProvider</link> object is required</para></listitem>
       <listitem><para>No data source (DSN) or connection string can be used</para></listitem>
+      <listitem><para>One must use the <link linkend="gda-virtual-connection-open">gda_virtual_connection_open()</link>
+	  method which creates and "opens" a virtual connection. </para></listitem>
     </itemizedlist>
     Here is an example of code on how to create a virtual connection using the <link linkend="GdaVproviderDataModel">GdaVproviderDataModel</link> virtual provider:
     <programlisting>
@@ -22,8 +23,7 @@
 GdaVirtualProvider *provider;
 
 provider = gda_vprovider_data_model_new ();
-cnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
-gda_connection_open (cnc, NULL);
+cnc = gda_virtual_connection_open (provider, NULL);
     </programlisting>
   </para>
   <para>

Modified: branches/V4-branch/libgda-report/engine/gda-report-engine.c
==============================================================================
--- branches/V4-branch/libgda-report/engine/gda-report-engine.c	(original)
+++ branches/V4-branch/libgda-report/engine/gda-report-engine.c	Thu Feb 21 17:19:02 2008
@@ -999,11 +999,9 @@
 
 		if (!provider)
 			provider = gda_vprovider_data_model_new ();
-		vcnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, 0);
-		if (! gda_connection_open (vcnc, error)) {
-			g_object_unref (vcnc);
+		vcnc = gda_virtual_connection_open (provider, error);
+		if (! vcnc) 
 			return NULL;
-		}
 	}
 
 	/* parser */

Modified: branches/V4-branch/libgda/Makefile.am
==============================================================================
--- branches/V4-branch/libgda/Makefile.am	(original)
+++ branches/V4-branch/libgda/Makefile.am	Thu Feb 21 17:19:02 2008
@@ -27,7 +27,6 @@
 gda_headers = \
 	gda-batch.h \
 	gda-blob-op.h \
-	gda-client.h \
 	gda-column.h \
 	gda-column-index.h \
 	gda-config.h \
@@ -51,6 +50,7 @@
 	gda-data-proxy.h \
 	gda-debug-macros.h \
 	gda-decl.h \
+	gda-easy.h \
 	gda-enums.h \
 	gda-holder.h \
 	gda-log.h \
@@ -79,7 +79,6 @@
 	dir-blob-op.c \
 	$(gda_headers) \
 	gda-blob-op.c \
-	gda-client.c \
 	gda-column.c \
 	gda-column-index.c \
 	gda-config.c \
@@ -100,6 +99,7 @@
 	gda-data-model-query.c \
 	gda-data-access-wrapper.c \
 	gda-data-proxy.c \
+	gda-easy.c \
 	gda-holder.c \
 	gda-init.c \
 	gda-log.c \

Modified: branches/V4-branch/libgda/gda-connection.c
==============================================================================
--- branches/V4-branch/libgda/gda-connection.c	(original)
+++ branches/V4-branch/libgda/gda-connection.c	Thu Feb 21 17:19:02 2008
@@ -25,8 +25,6 @@
 
 #undef GDA_DISABLE_DEPRECATED
 #include <stdio.h>
-#include <libgda/gda-client.h>
-#include <libgda/gda-client-private.h>
 #include <libgda/gda-config.h>
 #include <libgda/gda-connection.h>
 #include <libgda/gda-connection-private.h>
@@ -46,7 +44,6 @@
 #define PROV_CLASS(provider) (GDA_SERVER_PROVIDER_CLASS (G_OBJECT_GET_CLASS (provider)))
 
 struct _GdaConnectionPrivate {
-	GdaClient            *client;
 	GdaServerProvider    *provider_obj;
 	GdaConnectionOptions  options; /* ORed flags */
 	gchar                *dsn;
@@ -94,7 +91,6 @@
 enum
 {
         PROP_0,
-	PROP_CLIENT,
         PROP_DSN,
         PROP_CNC_STRING,
         PROP_PROVIDER_OBJ,
@@ -169,10 +165,6 @@
         object_class->set_property = gda_connection_set_property;
         object_class->get_property = gda_connection_get_property;
 
-	g_object_class_install_property (object_class, PROP_CLIENT,
-                                         g_param_spec_object ("client", _("GdaClient to use"), NULL,
-                                                               GDA_TYPE_CLIENT,
-							       (G_PARAM_READABLE | G_PARAM_WRITABLE)));
 	g_object_class_install_property (object_class, PROP_DSN,
                                          g_param_spec_string ("dsn", _("DSN to use"), NULL, NULL,
 							      (G_PARAM_READABLE | G_PARAM_WRITABLE)));
@@ -208,7 +200,6 @@
 	g_return_if_fail (GDA_IS_CONNECTION (cnc));
 
 	cnc->priv = g_new0 (GdaConnectionPrivate, 1);
-	cnc->priv->client = NULL;
 	cnc->priv->provider_obj = NULL;
 	cnc->priv->dsn = NULL;
 	cnc->priv->cnc_string = NULL;
@@ -324,14 +315,6 @@
         cnc = GDA_CONNECTION (object);
         if (cnc->priv) {
                 switch (param_id) {
-                case PROP_CLIENT:
-                        if (cnc->priv->client)
-				g_object_unref(cnc->priv->client);
-
-			cnc->priv->client = g_value_get_object (value);
-			if (cnc->priv->client)
-				g_object_ref (cnc->priv->client);
-			break;
                 case PROP_DSN:
 			gda_connection_set_dsn (cnc, g_value_get_string (value));
                         break;
@@ -384,9 +367,6 @@
         cnc = GDA_CONNECTION (object);
         if (cnc->priv) {
                 switch (param_id) {
-                case PROP_CLIENT:
-			g_value_set_object (value, G_OBJECT (cnc->priv->client));
-			break;
                 case PROP_DSN:
 			g_value_set_string (value, cnc->priv->dsn);
                         break;
@@ -410,6 +390,176 @@
 }
 
 /**
+ * gda_connection_open_from_dsn
+ * @dsn: data source name.
+ * @auth_string: authentification string
+ * @options: options for the connection (see #GdaConnectionOptions).
+ * @error: a place to store an error, or %NULL
+ *
+ * This function is the way of opening database connections with libgda.
+ *
+ * Establishes a connection to a data source. 
+ *
+ * The @auth_string must contain the authentification information for the server
+ * to accept the connection. It is a string containing semi-colon seperated named value, usually 
+ * like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. 
+ * The actual named parameters required depend on the provider being used, and that list is available
+ * as the <parameter>auth_params</parameter> member of the #GdaProviderInfo struncture for each installed
+ * provider (use gda_config_get_provider_info() to get it). Also one can use the "gda-sql-4.0 -L" command to 
+ * list the possible named parameters.
+ *
+ * If a new #GdaConnection is created, then the caller will hold a reference on it.
+ *
+ * Returns: the opened connection if successful, %NULL if there was an error.
+ */
+GdaConnection *
+gda_connection_open_from_dsn (const gchar *dsn, const gchar *auth_string, 
+			      GdaConnectionOptions options, GError **error)
+{
+	GdaConnection *cnc = NULL;
+	GdaDataSourceInfo *dsn_info;
+
+	g_return_val_if_fail (dsn && *dsn, NULL);
+
+	/* get the data source info */
+	dsn_info = gda_config_get_dsn (dsn);
+	if (!dsn_info) {
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_DSN_NOT_FOUND_ERROR, 
+			     _("Data source %s not found in configuration"), dsn);
+		return NULL;
+	}
+
+	/* try to find provider */
+	if (dsn_info->provider != NULL) {
+		GdaServerProvider *prov;
+
+		prov = gda_config_get_provider_object (dsn_info->provider, error);
+		if (prov) {
+			if (PROV_CLASS (prov)->create_connection) {
+				cnc = PROV_CLASS (prov)->create_connection (prov);
+				if (cnc) {
+					g_object_set (G_OBJECT (cnc), "provider_obj", prov, NULL);
+					if (dsn && *dsn)
+						g_object_set (G_OBJECT (cnc), "dsn", dsn, NULL);
+					g_object_set (G_OBJECT (cnc), "auth_string", auth_string, "options", options, NULL);
+				}
+			}
+			else
+				cnc = g_object_new (GDA_TYPE_CONNECTION, "provider_obj", prov, 
+						    "dsn", dsn, "auth_string", auth_string, 
+						    "options", options, NULL);
+			
+			/* open connection */
+			if (!gda_connection_open (cnc, error)) {
+				g_object_unref (cnc);
+				cnc = NULL;
+			}
+		}
+	}
+	else 
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_NOT_FOUND_ERROR, 
+			     _("Datasource configuration error: no provider specified"));
+
+	return cnc;
+}
+
+/**
+ * gda_connection_open_from_string
+ * @provider_name: provider ID to connect to, or %NULL
+ * @cnc_string: connection string.
+ * @auth_string: authentification string
+ * @options: options for the connection (see #GdaConnectionOptions).
+ * @error: a place to store an error, or %NULL
+ *
+ * Opens a connection given a provider ID and a connection string. This
+ * allows applications to open connections without having to create
+ * a data source in the configuration. The format of @cnc_string is
+ * similar to PostgreSQL and MySQL connection strings. It is a semicolumn-separated
+ * series of key=value pairs. Do not add extra whitespace after the semicolumn
+ * separator. The possible keys depend on the provider, the "gda-sql-4.0 -L" command
+ * can be used to list the actual keys for each installed database provider.
+ *
+ * For example the connection string to open an SQLite connection to a database
+ * file named "my_data.db" in the current directory would be "DB_DIR=.;DB_NAME=my_data".
+ *
+ * The @auth_string must contain the authentification information for the server
+ * to accept the connection. It is a string containing semi-colon seperated named value, usually 
+ * like "USERNAME=...;PASSWORD=..." where the ... are replaced by actual values. 
+ * The actual named parameters required depend on the provider being used, and that list is available
+ * as the <parameter>auth_params</parameter> member of the #GdaProviderInfo struncture for each installed
+ * provider (use gda_config_get_provider_info() to get it). Similarly to the format of the connection
+ * string, use the "gda-sql-4.0 -L" command to list the possible named parameters.
+ *
+ * Additionnally, it is possible to have the connection string
+ * respect the "&lt;provider_name&gt;://&lt;real cnc string&gt;" format, in which case the provider name
+ * and the real connection string will be extracted from that string (note that if @provider_name
+ * is not %NULL then it will still be used as the provider ID).
+ *
+ * Returns: the opened connection if successful, %NULL if there is
+ * an error.
+ */
+GdaConnection *
+gda_connection_open_from_string (const gchar *provider_name, const gchar *cnc_string, const gchar *auth_string,
+				 GdaConnectionOptions options, GError **error)
+{
+	GdaConnection *cnc = NULL;
+	gchar *ptr, *dup;
+
+	g_return_val_if_fail (cnc_string && *cnc_string, NULL);
+
+	/* try to see if connection string has the "<provider>://<real cnc string>" format */
+	dup = g_strdup (cnc_string);
+	for (ptr = dup; *ptr; ptr++) {
+		if ((*ptr == ':') && (*(ptr+1) == '/') && (*(ptr+2) == '/')) {
+			if (!provider_name)
+				provider_name = dup;
+			*ptr = 0;
+			cnc_string = ptr + 3;
+		}
+	}
+	
+	if (!provider_name) {
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_NOT_FOUND_ERROR, 
+			     _("No provider specified"));
+		g_free (dup);
+		return NULL;
+	}
+
+	/* try to find provider */
+	if (provider_name) {
+		GdaServerProvider *prov;
+
+		prov = gda_config_get_provider_object (provider_name, error);
+		if (prov) {
+			if (PROV_CLASS (prov)->create_connection) {
+				cnc = PROV_CLASS (prov)->create_connection (prov);
+				if (cnc) {
+					g_object_set (G_OBJECT (cnc), "provider_obj", prov, NULL);
+					if (cnc_string && *cnc_string)
+						g_object_set (G_OBJECT (cnc), "cnc_string", cnc_string, NULL);
+					g_object_set (G_OBJECT (cnc), "auth_string", auth_string, "options", options, NULL);
+				}
+			}
+			else 
+				cnc = (GdaConnection *) g_object_new (GDA_TYPE_CONNECTION, "provider_obj", prov,
+								      "cnc-string", cnc_string, "auth_string", auth_string,
+								      "options", options, NULL);
+			
+			/* open the connection */
+			if (!gda_connection_open (cnc, error)) {
+				g_object_unref (cnc);
+				cnc = NULL;
+			}
+		}
+	}	
+
+	g_free (dup);
+
+	return cnc;
+}
+
+
+/**
  * gda_connection_open
  * @cnc: a #GdaConnection object
  * @error: a place to store errors, or %NULL
@@ -458,11 +608,15 @@
 
 	/* provider test */
 	if (!cnc->priv->provider_obj) {
-		gda_log_error (_("No provider specified"));
 		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_NO_PROVIDER_SPEC_ERROR,
 			     _("No provider specified"));
 		return FALSE;
 	}
+	if (!PROV_CLASS (cnc->priv->provider_obj)->open_connection) {
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_ERROR,
+			     _("Internal error: provider does not implement the open_connection() virtual method"));
+		return FALSE;
+	}
 
 	params = gda_quark_list_new_from_string (cnc->priv->cnc_string);
 
@@ -479,10 +633,10 @@
 
 	/* try to open the connection */
 	auth = gda_quark_list_new_from_string (real_auth_string);
-	if (gda_server_provider_open_connection (cnc->priv->provider_obj, cnc, params, auth)) {
+
+	if (PROV_CLASS (cnc->priv->provider_obj)->open_connection (cnc->priv->provider_obj, cnc, params, auth,
+								   NULL, NULL, NULL))
 		cnc->priv->is_open = TRUE;
-		_gda_client_notify_connection_opened_event (cnc->priv->client, cnc);
-	}
 	else {
 		const GList *events;
 		
@@ -498,8 +652,6 @@
 					if (error && !(*error))
 						g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_OPEN_ERROR,
 							     gda_connection_event_get_description (event));
-					_gda_client_notify_error_event (cnc->priv->client, cnc, 
-									GDA_CONNECTION_EVENT (l->data));
 				}
 			}
 		}
@@ -568,8 +720,8 @@
 	if (! cnc->priv->is_open)
 		return;
 
-	gda_server_provider_close_connection (cnc->priv->provider_obj, cnc);
-	_gda_client_notify_connection_closed_event (cnc->priv->client, cnc);
+	if (PROV_CLASS (cnc->priv->provider_obj)->close_connection) 
+		PROV_CLASS (cnc->priv->provider_obj)->close_connection (cnc->priv->provider_obj, cnc);
 	cnc->priv->is_open = FALSE;
 
 	if (cnc->priv->provider_data) {
@@ -606,24 +758,6 @@
 	return cnc->priv->is_open;
 }
 
-/**
- * gda_connection_get_client
- * @cnc: a #GdaConnection object.
- *
- * Gets the #GdaClient object associated with a connection. This
- * is always the client that created the connection, as returned
- * by #gda_client_open_connection.
- *
- * Returns: the client to which the connection belongs to.
- */
-GdaClient *
-gda_connection_get_client (GdaConnection *cnc)
-{
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
-	g_return_val_if_fail (cnc->priv, NULL);
-
-	return cnc->priv->client;
-}
 
 /**
  * gda_connection_get_options
@@ -785,8 +919,7 @@
  *
  * As soon as a provider (or a client, it does not matter) calls this
  * function with an @event object which is an error,
- * the connection object (and the associated #GdaClient object)
- * emits the "error" signal, to which clients can connect to be
+ * the connection object emits the "error" signal, to which clients can connect to be
  * informed of events.
  *
  * WARNING: the reference to the @event object is stolen by this function!
@@ -1374,17 +1507,14 @@
 gda_connection_begin_transaction (GdaConnection *cnc, const gchar *name, GdaTransactionIsolation level,
 				  GError **error)
 {
-	gboolean retval;
-
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);
 
-	retval = gda_server_provider_begin_transaction (cnc->priv->provider_obj, cnc, name, level, error);
-	if (retval)
-		_gda_client_notify_event (cnc->priv->client, cnc, GDA_CLIENT_EVENT_TRANSACTION_STARTED, NULL);
-
-	return retval;
+	if (PROV_CLASS (cnc->priv->provider_obj)->begin_transaction)
+		return PROV_CLASS (cnc->priv->provider_obj)->begin_transaction (cnc->priv->provider_obj, cnc, name, level, error);
+	else
+		return FALSE;
 }
 
 /**
@@ -1402,17 +1532,14 @@
 gboolean
 gda_connection_commit_transaction (GdaConnection *cnc, const gchar *name, GError **error)
 {
-	gboolean retval;
-
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);
 
-	retval = gda_server_provider_commit_transaction (cnc->priv->provider_obj, cnc, name, error);
-	if (retval)
-		_gda_client_notify_event (cnc->priv->client, cnc, GDA_CLIENT_EVENT_TRANSACTION_COMMITTED, NULL);
-
-	return retval;
+	if (PROV_CLASS (cnc->priv->provider_obj)->commit_transaction)
+		return PROV_CLASS (cnc->priv->provider_obj)->commit_transaction (cnc->priv->provider_obj, cnc, name, error);
+	else
+		return FALSE;
 }
 
 /**
@@ -1431,17 +1558,14 @@
 gboolean
 gda_connection_rollback_transaction (GdaConnection *cnc, const gchar *name, GError **error)
 {
-	gboolean retval;
-
 	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);
 
-	retval = gda_server_provider_rollback_transaction (cnc->priv->provider_obj, cnc, name, error);
-	if (retval)
-		_gda_client_notify_event (cnc->priv->client, cnc, GDA_CLIENT_EVENT_TRANSACTION_CANCELLED, NULL);
-
-	return retval;
+	if (PROV_CLASS (cnc->priv->provider_obj)->rollback_transaction)
+		return PROV_CLASS (cnc->priv->provider_obj)->rollback_transaction (cnc->priv->provider_obj, cnc, name, error);
+	else
+		return FALSE;
 }
 
 /**
@@ -1461,7 +1585,10 @@
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);
 	
-	return gda_server_provider_add_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	if (PROV_CLASS (cnc->priv->provider_obj)->add_savepoint)
+		return PROV_CLASS (cnc->priv->provider_obj)->add_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	else
+		return FALSE;
 }
 
 /**
@@ -1481,7 +1608,10 @@
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);	
 
-	return gda_server_provider_rollback_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	if (PROV_CLASS (cnc->priv->provider_obj)->rollback_savepoint)
+		return PROV_CLASS (cnc->priv->provider_obj)->rollback_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	else
+		return FALSE;
 }
 
 /**
@@ -1501,7 +1631,10 @@
 	g_return_val_if_fail (cnc->priv, FALSE);
 	g_return_val_if_fail (cnc->priv->provider_obj, FALSE);
 
-	return gda_server_provider_delete_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	if (PROV_CLASS (cnc->priv->provider_obj)->delete_savepoint)
+		return PROV_CLASS (cnc->priv->provider_obj)->delete_savepoint (cnc->priv->provider_obj, cnc, name, error);
+	else
+		return FALSE;
 }
 
 /**

Modified: branches/V4-branch/libgda/gda-connection.h
==============================================================================
--- branches/V4-branch/libgda/gda-connection.h	(original)
+++ branches/V4-branch/libgda/gda-connection.h	Thu Feb 21 17:19:02 2008
@@ -1,4 +1,4 @@
-/* GDA client library
+/* GDA library
  * Copyright (C) 1998 - 2008 The GNOME Foundation.
  *
  * AUTHORS:
@@ -47,6 +47,9 @@
 #define GDA_CONNECTION_ERROR gda_connection_error_quark ()
 
 typedef enum {
+	GDA_CONNECTION_DSN_NOT_FOUND_ERROR,
+	GDA_CONNECTION_PROVIDER_NOT_FOUND_ERROR,
+	GDA_CONNECTION_PROVIDER_ERROR,
         GDA_CONNECTION_CONN_OPEN_ERROR,
         GDA_CONNECTION_DO_QUERY_ERROR,
 	GDA_CONNECTION_NONEXIST_DSN_ERROR,
@@ -77,7 +80,6 @@
 typedef enum {
         GDA_CONNECTION_OPTIONS_NONE = 0,
 	GDA_CONNECTION_OPTIONS_READ_ONLY = 1 << 0,
-	GDA_CONNECTION_OPTIONS_DONT_SHARE = 2 << 0
 } GdaConnectionOptions;
 
 typedef enum {
@@ -128,12 +130,16 @@
 
 
 GType                gda_connection_get_type             (void) G_GNUC_CONST;
+GdaConnection       *gda_connection_open_from_dsn        (const gchar *dsn, const gchar *auth_string,
+							  GdaConnectionOptions options, GError **error);
+GdaConnection       *gda_connection_open_from_string     (const gchar *provider_name, 
+							  const gchar *cnc_string, const gchar *auth_string,
+							  GdaConnectionOptions options, GError **error);
 gboolean             gda_connection_open                 (GdaConnection *cnc, GError **error);
 void                 gda_connection_close                (GdaConnection *cnc);
 void                 gda_connection_close_no_warning     (GdaConnection *cnc);
 gboolean             gda_connection_is_opened            (GdaConnection *cnc);
 
-GdaClient           *gda_connection_get_client           (GdaConnection *cnc);
 GdaConnectionOptions gda_connection_get_options          (GdaConnection *cnc);
 
 GdaServerProvider   *gda_connection_get_provider_obj     (GdaConnection *cnc);

Modified: branches/V4-branch/libgda/gda-data-proxy.c
==============================================================================
--- branches/V4-branch/libgda/gda-data-proxy.c	(original)
+++ branches/V4-branch/libgda/gda-data-proxy.c	Thu Feb 21 17:19:02 2008
@@ -2784,9 +2784,8 @@
 
 	vcnc = proxy->priv->filter_vcnc;
 	if (!vcnc) {
-
-		vcnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, 0);
-		if (! gda_connection_open (vcnc, NULL)) {
+		vcnc = gda_virtual_connection_open (provider, NULL);
+		if (! vcnc) {
 			g_set_error (error, GDA_DATA_PROXY_ERROR, GDA_DATA_PROXY_FILTER_ERROR,
 				     _("Could not create virtual connection"));
 			g_object_unref (vcnc);

Added: branches/V4-branch/libgda/gda-easy.c
==============================================================================
--- (empty file)
+++ branches/V4-branch/libgda/gda-easy.c	Thu Feb 21 17:19:02 2008
@@ -0,0 +1,609 @@
+/* GDA Library
+ * Copyright (C) 2008 The GNOME Foundation.
+ *
+ * This Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this Library; see the file COPYING.LIB.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include <glib/gi18n-lib.h>
+#include <libgda/gda-easy.h>
+#include <libgda/gda-server-provider.h>
+#include <sql-parser/gda-sql-parser.h>
+#include <libgda/gda-config.h>
+
+static GdaSqlParser *internal_parser = NULL;
+
+/**
+ * gda_prepare_create_database
+ * @provider: the database provider to use
+ * @db_name: the name of the database to create, or %NULL
+ * @error: a place to store errors, or %NULL
+ *
+ * Creates a new #GdaServerOperation object which contains the specifications required
+ * to create a database. Once these specifications provided, use 
+ * gda_perform_create_database() to perform the database creation.
+ *
+ * If @db_name is left %NULL, then the name of the database to create will have to be set in the
+ * returned #GdaServerOperation using gda_server_operation_set_value_at().
+ *
+ * Returns: new #GdaServerOperation object, or %NULL if the provider does not support database
+ * creation
+ */
+GdaServerOperation *
+gda_prepare_create_database (const gchar *provider, const gchar *db_name, GError **error)
+{
+	GdaServerProvider *prov;
+
+	g_return_val_if_fail (provider && *provider, NULL);
+	g_return_val_if_fail (db_name && *db_name, NULL);
+
+	prov = gda_config_get_provider_object (provider, error);
+	if (prov) {
+		GdaServerOperation *op;
+		op = gda_server_provider_create_operation (prov, NULL, GDA_SERVER_OPERATION_CREATE_DB, 
+							   NULL, error);
+		if (op) {
+			g_object_set_data (G_OBJECT (op), "_gda_provider_obj", prov);
+			if (db_name)
+				gda_server_operation_set_value_at (op, db_name, NULL, "/DB_DEF_P/DB_NAME");
+		}
+		return op;
+	}
+	else
+		return NULL;
+}
+
+/**
+ * gda_perform_create_database
+ * @op: a #GdaServerOperation object obtained using gda_prepare_create_database()
+ * @error: a place to store en error, or %NULL
+ *
+ * Creates a new database using the specifications in @op, which must have been obtained using
+ * gda_prepare_create_database ()
+ *
+ * Returns: TRUE if no error occurred and the database has been created
+ */
+gboolean
+gda_perform_create_database (GdaServerOperation *op, GError **error)
+{
+	GdaServerProvider *provider;
+
+	g_return_val_if_fail (GDA_IS_SERVER_OPERATION (op), FALSE);
+
+	provider = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
+	if (provider) 
+		return gda_server_provider_perform_operation (provider, NULL, op, error);
+	else {
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_NOT_FOUND_ERROR, 
+			     _("Could not find operation's associated provider, "
+			       "did you use gda_prepare_create_database() ?")); 
+		return FALSE;
+	}
+}
+
+/**
+ * gda_prepare_drop_database
+ * @provider: the database provider to use
+ * @db_name: the name of the database to drop, or %NULL
+ * @error: a place to store errors, or %NULL
+ *
+ * Creates a new #GdaServerOperation object which contains the specifications required
+ * to drop a database. Once these specifications provided, use 
+ * gda_perform_drop_database() to perform the database creation.
+ *
+ * If @db_name is left %NULL, then the name of the database to drop will have to be set in the
+ * returned #GdaServerOperation using gda_server_operation_set_value_at().
+ *
+ * Returns: new #GdaServerOperation object, or %NULL if the provider does not support database
+ * destruction
+ */
+GdaServerOperation *
+gda_prepare_drop_database (const gchar *provider, const gchar *db_name, GError **error)
+{
+	GdaServerProvider *prov;
+	
+	g_return_val_if_fail (provider && *provider, NULL);
+	g_return_val_if_fail (db_name && *db_name, NULL);
+
+	prov = gda_config_get_provider_object (provider, error);
+	if (prov) {
+		GdaServerOperation *op;
+		op = gda_server_provider_create_operation (prov, NULL, GDA_SERVER_OPERATION_DROP_DB, 
+							   NULL, error);
+		if (op) {
+			g_object_set_data (G_OBJECT (op), "_gda_provider_obj", prov);
+			if (db_name)
+				gda_server_operation_set_value_at (op, db_name, NULL, "/DB_DESC_P/DB_NAME");
+		}
+		return op;
+	}
+	else
+		return NULL;
+}
+
+/**
+ * gda_perform_drop_database
+ * @op: a #GdaServerOperation object obtained using gda_prepare_drop_database()
+ * @error: a place to store en error, or %NULL
+ *
+ * Destroys an existing database using the specifications in @op,  which must have been obtained using
+ * gda_prepare_drop_database ()
+ *
+ * Returns: TRUE if no error occurred and the database has been destroyed
+ */
+gboolean
+gda_perform_drop_database (GdaServerOperation *op, GError **error)
+{
+	GdaServerProvider *provider;
+
+	g_return_val_if_fail (GDA_IS_SERVER_OPERATION (op), FALSE);
+
+	provider = g_object_get_data (G_OBJECT (op), "_gda_provider_obj");
+	if (provider) 
+		return gda_server_provider_perform_operation (provider, NULL, op, error);
+	else {
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_NOT_FOUND_ERROR, 
+			     _("Could not find operation's associated provider, "
+			       "did you use gda_prepare_drop_database() ?")); 
+		return FALSE;
+	}
+}
+
+/**
+ * gda_execute_select_command
+ * @cnc: an opened connection
+ * @sql: a query statament must begin with "SELECT"
+ * @error: a place to store errors, or %NULL
+ * 
+ * Execute a SQL SELECT command over an opened connection.
+ *
+ * Return: a new #GdaDataModel if succesfull, NULL otherwise
+ */
+GdaDataModel *          
+gda_execute_select_command (GdaConnection *cnc, const gchar *sql, GError **error)
+{
+	GdaStatement *stmt;
+	GdaDataModel *model;
+    
+	g_return_val_if_fail (sql != NULL 
+			      || GDA_IS_CONNECTION (cnc) 
+			      || !gda_connection_is_opened (cnc)
+			      || g_str_has_prefix (sql, "SELECT"),
+			      NULL);
+    
+	if (!internal_parser)
+		internal_parser = gda_sql_parser_new ();
+
+	stmt = gda_sql_parser_parse_string (internal_parser, sql, NULL, error);
+	if (!stmt) 
+		return NULL;
+	model = gda_connection_statement_execute_select (cnc, stmt, NULL, error);
+	g_object_unref (stmt);
+
+	return model;
+}
+
+/**
+ * gda_execute_sql_command
+ * @cnc: an opened connection
+ * @sql: a query statament must begin with "SELECT"
+ * @error: a place to store errors, or %NULL
+ *
+ * This is a convenient function to execute a SQL command over the opened connection.
+ *
+ * Returns: the number of rows affected or -1.
+ */
+gint
+gda_execute_non_select_command (GdaConnection *cnc, const gchar *sql, GError **error)
+{
+	GdaStatement *stmt;
+	gint retval;
+
+	g_return_val_if_fail (sql != NULL 
+			      || GDA_IS_CONNECTION (cnc) 
+			      || !gda_connection_is_opened (cnc), -1);
+    
+	if (!internal_parser)
+		internal_parser = gda_sql_parser_new ();
+
+	stmt = gda_sql_parser_parse_string (internal_parser, sql, NULL, error);
+	if (!stmt) 
+		return -1;
+    
+	retval = gda_connection_statement_execute_non_select (cnc, stmt, NULL, NULL, error);
+	g_object_unref (stmt);
+	return retval;
+}
+
+/**
+ * gda_create_table
+ * @cnc: an opened connection
+ * @table_name:
+ * @num_columns
+ * @error: a place to store errors, or %NULL
+ * @...: pairs of column name and #GType, finish with NULL
+ * 
+ * Create a Table over an opened connection using a pair list of colum name and 
+ * GType as arguments, you need to finish the list using NULL.
+ *
+ * This is just a convenient function to create tables quickly, 
+ * using defaults for the provider and converting the #GType passed to the corresponding 
+ * type in the provider; to use a custom type or more advanced characteristics in a 
+ * specific provider use the #GdaServerOperation framework.
+ *
+ * Returns: TRUE if the table was created; FALSE and set @error otherwise
+ */
+gboolean
+gda_create_table (GdaConnection *cnc, const gchar *table_name, GError **error, ...)
+{
+	GdaServerOperation *op;
+	GdaServerProvider *server;
+	
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	
+	server = gda_connection_get_provider_obj(cnc);
+	
+	op = gda_server_provider_create_operation (server, cnc, GDA_SERVER_OPERATION_CREATE_TABLE, NULL, error);
+	if (GDA_IS_SERVER_OPERATION (op)) {
+		va_list  args;
+		gchar   *arg;
+		GType    type;
+		gchar   *dbms_type;
+		xmlDocPtr parameters;
+		xmlNodePtr root;
+		xmlNodePtr table, op_data, array_data, array_row, array_value;
+		
+		if (table_name == NULL) {
+			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
+				     _("Couldn't create table with a NULL string"));
+			return FALSE;    
+		}
+		
+	
+		/* Initation of the xmlDoc */
+		parameters = xmlNewDoc ((xmlChar*)"1.0");
+		
+		root = xmlNewDocNode (parameters, NULL, (xmlChar*)"serv_op_data", NULL);
+		xmlDocSetRootElement (parameters, root);
+		table = xmlNewChild (root, NULL, (xmlChar*)"op_data", (xmlChar*)table_name);
+		xmlSetProp(table, (xmlChar*)"path", (xmlChar*)"/TABLE_DEF_P/TABLE_NAME");
+
+		op_data = xmlNewChild (root, NULL, (xmlChar*)"op_data", NULL);
+		xmlSetProp(op_data, (xmlChar*)"path", (xmlChar*)"/FIELDS_A");
+		array_data = xmlNewChild (op_data, NULL, (xmlChar*)"gda_array_data", NULL);
+			
+		va_start (args, error);
+		type = 0;
+		arg = NULL;
+		
+		while ((arg = va_arg (args, gchar*))) {
+			type = va_arg (args, GType);
+			if (type == 0) {
+				g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_INCORRECT_VALUE_ERROR, 
+					    _("Error the number of arguments are incorrect; couldn't create the table"));
+				g_object_unref (op);
+				xmlFreeDoc(parameters);
+				return FALSE;
+			}
+			
+			dbms_type = (gchar *) gda_server_provider_get_default_dbms_type (server, 
+											 cnc, type);
+			array_row = xmlNewChild (array_data, NULL, (xmlChar*)"gda_array_row", NULL);
+			array_value = xmlNewChild (array_row, NULL, (xmlChar*)"gda_array_value", (xmlChar*)arg);
+			xmlSetProp(array_value, (xmlChar*)"colid", (xmlChar*)"COLUMN_NAME");
+		
+			array_value = xmlNewChild(array_row, NULL, (xmlChar*)"gda_array_value", (xmlChar*)dbms_type);
+			xmlSetProp(array_value, (xmlChar*)"colid", (xmlChar*)"COLUMN_TYPE");
+			
+		}
+		
+		va_end(args);
+		
+		if (!gda_server_operation_load_data_from_xml (op, root, error)) {
+			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
+				     _("The XML operation doesn't exist or could't be loaded"));
+			g_object_unref (op);
+			xmlFreeDoc(parameters);
+			return FALSE;
+		}
+		else {
+			if (!gda_server_provider_perform_operation (server, cnc, op, error)) {
+				g_object_unref (op);
+				xmlFreeDoc(parameters);
+				return FALSE;
+			}
+		}
+		
+		g_object_unref (op);
+		xmlFreeDoc(parameters);
+	}
+	
+	return TRUE;
+}
+
+/**
+ * gda_drop_table
+ * @cnc: an opened connection
+ * @table_name:
+ * @error: a place to store errors, or %NULL
+ * 
+ * This is just a convenient function to drop a table in an opened connection.
+ *
+ * Returns: TRUE if the table was dropped
+ */
+gboolean
+gda_drop_table (GdaConnection *cnc, const gchar *table_name, GError **error)
+{
+	GdaServerOperation *op;
+	GdaServerProvider *server;
+	gboolean retval = TRUE;
+
+	server = gda_connection_get_provider_obj (cnc);
+	
+	op = gda_server_provider_create_operation (server, cnc, 
+						   GDA_SERVER_OPERATION_DROP_TABLE, NULL, error);
+	
+	if (GDA_IS_SERVER_OPERATION (op)) {
+		xmlDocPtr parameters;
+		xmlNodePtr root;
+		xmlNodePtr table;
+		
+		g_return_val_if_fail (table_name != NULL 
+				      || GDA_IS_CONNECTION (cnc) 
+				      || !gda_connection_is_opened (cnc), FALSE);
+    
+		parameters = xmlNewDoc ((xmlChar*)"1.0");
+		root = xmlNewDocNode (parameters, NULL, (xmlChar*)"serv_op_data", NULL);
+		xmlDocSetRootElement (parameters, root);
+		table = xmlNewChild (root, NULL, (xmlChar*)"op_data", (xmlChar*)table_name);
+		xmlSetProp(table, (xmlChar*)"path", (xmlChar*)"/TABLE_DESC_P/TABLE_NAME");
+	    
+		if (!gda_server_operation_load_data_from_xml (op, root, error)) {
+			/* error */
+			g_object_unref (op);
+			xmlFreeDoc(parameters);
+			retval = FALSE;
+		}
+		else {
+			if (gda_server_provider_perform_operation (server, cnc, op, error))
+				/* error */
+				g_object_unref (op);
+		        xmlFreeDoc(parameters);
+			return FALSE;
+		}
+		g_object_unref (op);
+		xmlFreeDoc(parameters);
+	}
+	else {
+		g_message("The Server doesn't support the DROP TABLE operation!\n\n");
+		retval = FALSE;
+	}
+    
+	return retval;
+}
+
+static guint
+gtype_hash (gconstpointer key)
+{
+        return (guint) key;
+}
+
+static gboolean 
+gtype_equal (gconstpointer a, gconstpointer b)
+{
+        return (GType) a == (GType) b ? TRUE : FALSE;
+}
+
+/**
+ * gda_get_default_handler
+ * @for_type: a #GType type
+ * 
+ * Obtain a pointer to a #GdaDataHandler which can manage #GValue values of type @for_type
+ *
+ * The returned pointer is %NULL if there is no default data handler available for the @for_type data type
+ *
+ * Returns: a #GdaDataHandler which must not be modified or destroyed.
+ */
+GdaDataHandler *
+gda_get_default_handler (GType for_type)
+{
+	static GHashTable *hash = NULL;
+	GdaDataHandler *dh;
+
+	if (!hash) {
+		hash = g_hash_table_new_full (gtype_hash, gtype_equal,
+					      NULL, (GDestroyNotify) g_object_unref);
+
+                g_hash_table_insert (hash, (gpointer) G_TYPE_INT64, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_UINT64, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_BINARY, gda_handler_bin_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_BLOB, gda_handler_bin_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_BOOLEAN, gda_handler_boolean_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_DATE, gda_handler_time_new_no_locale ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_DOUBLE, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_INT, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_NUMERIC, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_FLOAT, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_SHORT, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_USHORT, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_STRING, gda_handler_string_new ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_TIME, gda_handler_time_new_no_locale ());
+                g_hash_table_insert (hash, (gpointer) GDA_TYPE_TIMESTAMP, gda_handler_time_new_no_locale ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_CHAR, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_UCHAR, gda_handler_numerical_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_ULONG, gda_handler_type_new ());
+                g_hash_table_insert (hash, (gpointer) G_TYPE_UINT, gda_handler_numerical_new ());
+	}
+	
+	dh = g_hash_table_lookup (hash, (gpointer) for_type);
+	return dh;
+}
+
+/* Auxiliary struct to save and get the varian arguments */
+typedef struct {
+	gchar  *column_name;
+	GValue *value;
+} GdaValueArgument;
+
+/**
+ * gda_insert_row_into_table_from_string
+ * @cnc: an opened connection
+ * @table_name:
+ * @error: a place to store errors, or %NULL
+ * @...: a list of strings to be converted as value, finished by %NULL
+ * 
+ * This is just a convenient function to insert a row with the values given as arguments.
+ * The values must be strings that could be converted to the type in the corresponding
+ * column. Finish the list with NULL.
+ * 
+ * The arguments must be pairs of column name followed by his value.
+ *
+ * The SQL command is like: 
+ * INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...)
+ *
+ * Returns: TRUE if no error occurred, and FALSE and set error otherwise
+ */
+gboolean
+gda_insert_row_into_table_from_string (GdaConnection *cnc, const gchar *table_name, GError **error, ...)
+{        
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	g_return_val_if_fail (table_name && *table_name, FALSE);
+
+	TO_IMPLEMENT;
+	return FALSE;
+}
+
+/**
+ * gda_insert_row_into_table
+ * @cnc: an opened connection
+ * @table_name:
+ * @error: a place to store errors, or %NULL
+ * @...: a list of string/@GValue pairs where the string is the name of the column
+ * followed by its @GValue to set in the insert operation, finished by %NULL
+ * 
+ * This is just a convenient function to insert a row with the values given as argument.
+ * The values must correspond with the GType of the column to set, otherwise throw to 
+ * an error. Finish the list with NULL.
+ * 
+ * The arguments must be pairs of column name followed by his value.
+ * 
+ * Returns: TRUE if no error occurred, and FALSE and set error otherwise
+ */
+gboolean
+gda_insert_row_into_table (GdaConnection *cnc, const gchar *table_name, GError **error, ...)
+{
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	g_return_val_if_fail (table_name && *table_name, FALSE);
+
+	TO_IMPLEMENT;
+	return FALSE;
+}
+
+/**
+ * gda_delete_row_from_table
+ * @cnc: an opened connection
+ * @table_name:
+ * @condition_column_name: the name of the column to used in the WHERE condition clause
+ * @condition: a GValue to used to find the row to be deleted 
+ * @error: a place to store errors, or %NULL
+ *
+ * This is just a convenient function to delete the row fitting the given condition
+ * from the given table.
+ *
+ * @condition must be a valid GValue and must correspond with the GType of the column to use
+ * in the WHERE clause.
+ *
+ * The SQL command is like: DELETE FROM table_name WHERE contition_column_name = condition
+ *
+ * Returns: TRUE if no error occurred, and FALSE and set error otherwise
+ */
+gboolean              
+gda_delete_row_from_table (GdaConnection *cnc, const gchar *table_name, const gchar *condition_column_name, 
+			   const GValue *condition, GError **error)
+{
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	g_return_val_if_fail (table_name && *table_name, FALSE);
+
+	TO_IMPLEMENT;
+	return FALSE;
+}
+
+/**
+ * gda_update_value_in_table
+ * @cnc: an opened connection
+ * @table_name:
+ * @search_for_column: the name of the column to used in the WHERE condition clause
+ * @condition: a GValue to used to find the value to be updated; it must correspond with the GType
+ * of the column used to search
+ * @column_name: the column containing the value to be updated
+ * @new_value: the new value to update to; the @GValue must correspond with the GType of the column to update
+ * @error: a place to store errors, or %NULL
+ * 
+ * This is just a convenient function to update values in a table on a given column where
+ * the row is fitting the given condition.
+ *
+ * The SQL command is like: UPDATE INTO table_name SET column_name = new_value WHERE search_for_column = condition
+ *
+ * Returns: TRUE if no error occurred
+ */
+gboolean              
+gda_update_value_in_table (GdaConnection *cnc, 
+			   const gchar *table_name, const gchar *search_for_column, 
+			   const GValue *condition, 
+			   const gchar *column_name, const GValue *new_value, GError **error)
+{
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	g_return_val_if_fail (table_name && *table_name, FALSE);
+
+	TO_IMPLEMENT;
+	return FALSE;
+}
+
+/**
+ * gda_update_values_in_table
+ * @cnc: an opened connection
+ * @table_name: the name of the table where the update will be done
+ * @condition_column_name: the name of the column to used in the WHERE condition clause
+ * @condition: a GValue to used to find the values to be updated; it must correspond with the
+ * column's @GType
+ * @error: a place to store errors, or %NULL
+ * @...: a list of string/@GValue pairs where the string is the name of the column to be 
+ * updated followed by the new @GValue to set, finished by %NULL
+ * 
+ * This is just a convenient function to update values in a table on a given column where
+ * the row is fitting the given condition.
+ *
+ * The SQL command is like: 
+ * UPDATE INTO table_name SET column1 = new_value1, column2 = new_value2 ... WHERE condition_column_name = condition
+ *
+ * Returns: TRUE if no error occurred
+ */
+gboolean              
+gda_update_values_in_table (GdaConnection *cnc, const gchar *table_name, 
+			    const gchar *condition_column_name, const GValue *condition, 
+			    GError **error, ...)
+{
+	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
+	g_return_val_if_fail (gda_connection_is_opened (cnc), FALSE);
+	g_return_val_if_fail (table_name && *table_name, FALSE);
+
+	TO_IMPLEMENT;
+	return FALSE;
+}

Added: branches/V4-branch/libgda/gda-easy.h
==============================================================================
--- (empty file)
+++ branches/V4-branch/libgda/gda-easy.h	Thu Feb 21 17:19:02 2008
@@ -0,0 +1,93 @@
+/* GDA library
+ * Copyright (C) 2008 The GNOME Foundation.
+ *
+ * AUTHORS:
+ *      Vivien Malerba <malerba gnome-db org>
+ *
+ * This Library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This Library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this Library; see the file COPYING.LIB.  If not,
+ * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __GDA_EASY_H__
+#define __GDA_EASY_H__
+
+#include <libgda/gda-connection.h>
+#include <libgda/gda-server-operation.h>
+#include <libgda/handlers/gda-handler-bin.h>
+#include <libgda/handlers/gda-handler-boolean.h>
+#include <libgda/handlers/gda-handler-numerical.h>
+#include <libgda/handlers/gda-handler-string.h>
+#include <libgda/handlers/gda-handler-time.h>
+#include <libgda/handlers/gda-handler-type.h>
+
+G_BEGIN_DECLS
+
+extern GQuark gda_general_error_quark (void);
+#define GDA_GENERAL_ERROR gda_general_error_quark ()
+
+typedef enum  {
+    GDA_GENERAL_OBJECT_NAME_ERROR,
+    GDA_GENERAL_INCORRECT_VALUE_ERROR,
+    GDA_GENERAL_OPERATION_ERROR
+} GdaGeneralError;
+
+/* 
+ * Convenient Functions
+ */
+GdaDataHandler     *gda_get_default_handler           (GType for_type);
+
+/*
+ * Quick commands execution
+ */
+GdaDataModel*       gda_execute_select_command        (GdaConnection *cnc, const gchar *sql, GError **error);
+gint                gda_execute_non_select_command    (GdaConnection *cnc, const gchar *sql, GError **error);
+
+
+/*
+ * Database creation and destruction
+ */
+GdaServerOperation *gda_prepare_create_database       (const gchar *provider, const gchar *db_name, GError **error);
+gboolean            gda_perform_create_database       (GdaServerOperation *op, GError **error);
+GdaServerOperation *gda_prepare_drop_database         (const gchar *provider, const gchar *db_name, GError **error);
+gboolean            gda_perform_drop_database         (GdaServerOperation *op, GError **error);
+
+/*
+ * Tables creation and destruction
+ */
+gboolean            gda_create_table                  (GdaConnection *cnc, const gchar *table_name, GError **error, ...);
+gboolean            gda_drop_table                    (GdaConnection *cnc, const gchar *table_name, GError **error);
+
+/*
+ * Data in tables manipulation
+ */
+gboolean            gda_insert_row_into_table         (GdaConnection *cnc, const gchar *table_name, GError **error, ...);
+gboolean            gda_insert_row_into_table_from_string  (GdaConnection *cnc, const gchar *table_name, GError **error, ...);
+gboolean            gda_update_value_in_table         (GdaConnection *cnc, const gchar *table_name, 
+						       const gchar *search_for_column, 
+						       const GValue *condition, 
+						       const gchar *column_name, 
+						       const GValue *new_value, GError **error);
+gboolean            gda_update_values_in_table        (GdaConnection *cnc, const gchar *table_name, 
+						       const gchar *condition_column_name, 
+						       const GValue *condition, 
+						       GError **error, ...);
+gboolean            gda_delete_row_from_table         (GdaConnection *cnc, const gchar *table_name, 
+						       const gchar *condition_column_name, const GValue *condition, 
+						       GError **error);
+
+
+G_END_DECLS
+
+#endif

Modified: branches/V4-branch/libgda/gda-init.c
==============================================================================
--- branches/V4-branch/libgda/gda-init.c	(original)
+++ branches/V4-branch/libgda/gda-init.c	Thu Feb 21 17:19:02 2008
@@ -30,7 +30,6 @@
 #define GDA_UNLOCK() g_static_rec_mutex_unlock(&gda_mutex)
 
 static GMainLoop *main_loop = NULL;
-static GdaSqlParser *internal_parser;
 
 /* global variables */
 xmlDtdPtr       gda_array_dtd = NULL;
@@ -107,9 +106,6 @@
 	/* binreloc */
 	gda_gbr_init ();
 
-	/* internal parser for easy API */
-	internal_parser = gda_sql_parser_new ();
-
 	/* array DTD */
 	file = gda_gbr_get_file_path (GDA_DATA_DIR, LIBGDA_ABI_NAME, "dtd", "libgda-array.dtd", NULL);
 	gda_array_dtd = xmlParseDTD (NULL, (xmlChar*)file);
@@ -231,495 +227,3 @@
 		quark = g_quark_from_static_string ("gda_general_error");
 	return quark;
 }
-
-/**
- * gda_execute_select_command
- * @cnn: an opened connection
- * @sql: a query statament must begin with "SELECT"
- * @error: a place to store errors, or %NULL
- * 
- * Execute a SQL SELECT command over an opened connection.
- *
- * Return: a new #GdaDataModel if succesfull, NULL otherwise
- */
-GdaDataModel *          
-gda_execute_select_command (GdaConnection *cnn, const gchar *sql, GError **error)
-{
-	GdaStatement *stmt;
-	GdaDataModel *model;
-    
-	g_return_val_if_fail (sql != NULL 
-			      || GDA_IS_CONNECTION (cnn) 
-			      || !gda_connection_is_opened (cnn)
-			      || g_str_has_prefix (sql, "SELECT"),
-			      NULL);
-    
-	stmt = gda_sql_parser_parse_string (internal_parser, sql, NULL, error);
-	if (!stmt) 
-		return NULL;
-	model = gda_connection_statement_execute_select (cnn, stmt, NULL, error);
-	g_object_unref (stmt);
-
-	return model;
-}
-
-/**
- * gda_execute_sql_command
- * @cnn: an opened connection
- * @sql: a query statament must begin with "SELECT"
- * @error: a place to store errors, or %NULL
- *
- * This is a convenient function to execute a SQL command over the opened connection.
- *
- * Returns: the number of rows affected or -1.
- */
-gint
-gda_execute_sql_command (GdaConnection *cnn, const gchar *sql, GError **error)
-{
-	GdaStatement *stmt;
-	gint retval;
-
-	g_return_val_if_fail (sql != NULL 
-			      || GDA_IS_CONNECTION (cnn) 
-			      || !gda_connection_is_opened (cnn), -1);
-    
-	stmt = gda_sql_parser_parse_string (internal_parser, sql, NULL, error);
-	if (!stmt) 
-		return -1;
-    
-	retval = gda_connection_statement_execute_non_select (cnn, stmt, NULL, NULL, error);
-	g_object_unref (stmt);
-	return retval;
-}
-
-/**
- * gda_create_table
- * @cnn: an opened connection
- * @table_name:
- * @num_columns
- * @error: a place to store errors, or %NULL
- * @...: pairs of column name and #GType, finish with NULL
- * 
- * Create a Table over an opened connection using a pair list of colum name and 
- * GType as arguments, you need to finish the list using NULL.
- *
- * This is just a convenient function to create tables quickly, 
- * using defaults for the provider and converting the #GType passed to the corresponding 
- * type in the provider; to use a custom type or more advanced characteristics in a 
- * specific provider use the #GdaServerOperation framework.
- *
- * Returns: TRUE if the table was created; FALSE and set @error otherwise
- */
-gboolean
-gda_create_table (GdaConnection *cnn, const gchar *table_name, GError **error, ...)
-{
-	GdaServerOperation *op;
-	GdaServerProvider *server;
-	
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	
-	server = gda_connection_get_provider_obj(cnn);
-	
-	op = gda_server_provider_create_operation (server, cnn, 
-						   GDA_SERVER_OPERATION_CREATE_TABLE, NULL, error);
-	if (GDA_IS_SERVER_OPERATION (op)) {
-		va_list  args;
-		gchar   *arg;
-		GType    type;
-		gchar   *dbms_type;
-		xmlDocPtr parameters;
-		xmlNodePtr root;
-		xmlNodePtr table, op_data, array_data, array_row, array_value;
-		
-		if (table_name == NULL) {
-			g_message("Table name is NULL!");      
-			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
-				    "Couldn't create table with a NULL string");
-			return FALSE;    
-		}
-		
-	
-		/* Initation of the xmlDoc */
-		parameters = xmlNewDoc ((xmlChar*)"1.0");
-		
-		root = xmlNewDocNode (parameters, NULL, (xmlChar*)"serv_op_data", NULL);
-		xmlDocSetRootElement (parameters, root);
-		table = xmlNewChild (root, NULL, (xmlChar*)"op_data", (xmlChar*)table_name);
-		xmlSetProp(table, (xmlChar*)"path", (xmlChar*)"/TABLE_DEF_P/TABLE_NAME");
-
-		op_data = xmlNewChild (root, NULL, (xmlChar*)"op_data", NULL);
-		xmlSetProp(op_data, (xmlChar*)"path", (xmlChar*)"/FIELDS_A");
-		array_data = xmlNewChild (op_data, NULL, (xmlChar*)"gda_array_data", NULL);
-			
-		va_start (args, error);
-		type = 0;
-		arg = NULL;
-		
-		while ((arg = va_arg (args, gchar*))) {
-			g_message("Getting the arguments...");			
-			type = va_arg (args, GType);
-			if (type == 0) {
-				g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_INCORRECT_VALUE_ERROR, 
-					    "Error the number of arguments are incorrect; couldn't create the table");
-				g_object_unref (op);
-				xmlFreeDoc(parameters);
-				return FALSE;
-			}
-			
-			dbms_type = (gchar *) gda_server_provider_get_default_dbms_type (server, 
-											 cnn, type);
-			array_row = xmlNewChild (array_data, NULL, (xmlChar*)"gda_array_row", NULL);
-			array_value = xmlNewChild (array_row, NULL, (xmlChar*)"gda_array_value", (xmlChar*)arg);
-			xmlSetProp(array_value, (xmlChar*)"colid", (xmlChar*)"COLUMN_NAME");
-		
-			array_value = xmlNewChild(array_row, NULL, (xmlChar*)"gda_array_value", (xmlChar*)dbms_type);
-			xmlSetProp(array_value, (xmlChar*)"colid", (xmlChar*)"COLUMN_TYPE");
-			
-		}
-		
-		va_end(args);
-		
-		if (!gda_server_operation_load_data_from_xml (op, root, error)) {
-			/* error */
-			g_set_error (error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
-				     "The XML operation doesn't exist or could't be loaded");
-			g_object_unref (op);
-			xmlFreeDoc(parameters);
-			return FALSE;
-		}
-		else {
-			if (gda_server_provider_perform_operation (server, cnn, op, error)) {
-				/* error */
-				g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_OPERATION_ERROR, 
-					    "The Server couldn't perform the CREATE TABLE operation!");
-				g_object_unref (op);
-				xmlFreeDoc(parameters);
-				return FALSE;
-			}
-		}
-		
-		g_object_unref (op);
-		xmlFreeDoc(parameters);
-	}
-	else {
-		g_set_error(error, GDA_GENERAL_ERROR, GDA_GENERAL_OBJECT_NAME_ERROR, 
-			    "The Server doesn't support the CREATE TABLE operation!");
-		return FALSE;
-	}
-	return TRUE;
-}
-
-/**
- * gda_drop_table
- * @cnn: an opened connection
- * @table_name:
- * @error: a place to store errors, or %NULL
- * 
- * This is just a convenient function to drop a table in an opened connection.
- *
- * Returns: TRUE if the table was dropped
- */
-gboolean
-gda_drop_table (GdaConnection *cnn, const gchar *table_name, GError **error)
-{
-	GdaServerOperation *op;
-	GdaServerProvider *server;
-	gboolean retval = TRUE;
-
-	server = gda_connection_get_provider_obj (cnn);
-	
-	op = gda_server_provider_create_operation (server, cnn, 
-						   GDA_SERVER_OPERATION_DROP_TABLE, NULL, error);
-	
-	if (GDA_IS_SERVER_OPERATION (op)) {
-		xmlDocPtr parameters;
-		xmlNodePtr root;
-		xmlNodePtr table;
-		
-		g_return_val_if_fail (table_name != NULL 
-				      || GDA_IS_CONNECTION (cnn) 
-				      || !gda_connection_is_opened (cnn), FALSE);
-    
-		parameters = xmlNewDoc ((xmlChar*)"1.0");
-		root = xmlNewDocNode (parameters, NULL, (xmlChar*)"serv_op_data", NULL);
-		xmlDocSetRootElement (parameters, root);
-		table = xmlNewChild (root, NULL, (xmlChar*)"op_data", (xmlChar*)table_name);
-		xmlSetProp(table, (xmlChar*)"path", (xmlChar*)"/TABLE_DESC_P/TABLE_NAME");
-	    
-		if (!gda_server_operation_load_data_from_xml (op, root, error)) {
-			/* error */
-			g_object_unref (op);
-			xmlFreeDoc(parameters);
-			retval = FALSE;
-		}
-		else {
-			if (gda_server_provider_perform_operation (server, cnn, op, error))
-				/* error */
-				g_object_unref (op);
-		        xmlFreeDoc(parameters);
-			return FALSE;
-		}
-		g_object_unref (op);
-		xmlFreeDoc(parameters);
-	}
-	else {
-		g_message("The Server doesn't support the DROP TABLE operation!\n\n");
-		retval = FALSE;
-	}
-    
-	return retval;
-}
-
-static guint
-gtype_hash (gconstpointer key)
-{
-        return (guint) key;
-}
-
-static gboolean 
-gtype_equal (gconstpointer a, gconstpointer b)
-{
-        return (GType) a == (GType) b ? TRUE : FALSE;
-}
-
-/**
- * gda_get_default_handler
- * @for_type: a #GType type
- * 
- * Obtain a pointer to a #GdaDataHandler which can manage #GValue values of type @for_type
- *
- * The returned pointer is %NULL if there is no default data handler available for the @for_type data type
- *
- * Returns: a #GdaDataHandler which must not be modified or destroyed.
- */
-GdaDataHandler *
-gda_get_default_handler (GType for_type)
-{
-	static GHashTable *hash = NULL;
-	GdaDataHandler *dh;
-
-	if (!hash) {
-		hash = g_hash_table_new_full (gtype_hash, gtype_equal,
-					      NULL, (GDestroyNotify) g_object_unref);
-
-                g_hash_table_insert (hash, (gpointer) G_TYPE_INT64, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_UINT64, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_BINARY, gda_handler_bin_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_BLOB, gda_handler_bin_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_BOOLEAN, gda_handler_boolean_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_DATE, gda_handler_time_new_no_locale ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_DOUBLE, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_INT, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_NUMERIC, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_FLOAT, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_SHORT, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_USHORT, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_STRING, gda_handler_string_new ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_TIME, gda_handler_time_new_no_locale ());
-                g_hash_table_insert (hash, (gpointer) GDA_TYPE_TIMESTAMP, gda_handler_time_new_no_locale ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_CHAR, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_UCHAR, gda_handler_numerical_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_ULONG, gda_handler_type_new ());
-                g_hash_table_insert (hash, (gpointer) G_TYPE_UINT, gda_handler_numerical_new ());
-	}
-	
-	dh = g_hash_table_lookup (hash, (gpointer) for_type);
-	return dh;
-}
-
-/**
- * gda_open_connection
- * @dsn: a data source name
- * @username:
- * @password:
- * @options:
- * @error: a place to store errors, or %NULL
- * 
- * Convenient function to open a connection to a Data Source, 
- * see also gda_client_open_connection().
- *
- * Returns: a #GdaConnection object if the connection was sucessfully opened, %NULL otherwise
- */
-GdaConnection *
-gda_open_connection (const gchar *dsn, const gchar *username, const gchar *password, 
-		     GdaConnectionOptions options, GError **error)
-{
-	static GdaClient *client = NULL;
-	GdaConnection *cnn;
-	gchar *auth_string = NULL;
-	
-	g_return_val_if_fail (dsn != NULL, NULL);
-	
-	if (!client)
-		client = gda_client_new ();
-	
-	if (username) {
-		if (password)
-			auth_string = g_strdup_printf ("USERNAME=%s;PASSWORD=%s", username, password);
-		else
-			auth_string = g_strdup_printf ("USERNAME=%s", username);
-	}
-	cnn = gda_client_open_connection (client, dsn, auth_string, options, error);
-	g_free (auth_string);
-	
-	return cnn;
-    
-}
-
-
-/* Auxiliary struct to save and get the varian arguments */
-typedef struct {
-	gchar  *column_name;
-	GValue *value;
-} GdaValueArgument;
-
-/**
- * gda_insert_row_into_table_from_string
- * @cnn: an opened connection
- * @table_name:
- * @error: a place to store errors, or %NULL
- * @...: a list of strings to be converted as value, finished by %NULL
- * 
- * This is just a convenient function to insert a row with the values given as arguments.
- * The values must be strings that could be converted to the type in the corresponding
- * column. Finish the list with NULL.
- * 
- * The arguments must be pairs of column name followed by his value.
- *
- * The SQL command is like: 
- * INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...)
- *
- * Returns: TRUE if no error occurred, and FALSE and set error otherwise
- */
-gboolean
-gda_insert_row_into_table_from_string (GdaConnection *cnn, const gchar *table_name, GError **error, ...)
-{        
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	g_return_val_if_fail (table_name && *table_name, FALSE);
-
-	TO_IMPLEMENT;
-	return FALSE;
-}
-
-/**
- * gda_insert_row_into_table
- * @cnn: an opened connection
- * @table_name:
- * @error: a place to store errors, or %NULL
- * @...: a list of string/@GValue pairs where the string is the name of the column
- * followed by its @GValue to set in the insert operation, finished by %NULL
- * 
- * This is just a convenient function to insert a row with the values given as argument.
- * The values must correspond with the GType of the column to set, otherwise throw to 
- * an error. Finish the list with NULL.
- * 
- * The arguments must be pairs of column name followed by his value.
- * 
- * Returns: TRUE if no error occurred, and FALSE and set error otherwise
- */
-gboolean
-gda_insert_row_into_table (GdaConnection *cnn, const gchar *table_name, GError **error, ...)
-{
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	g_return_val_if_fail (table_name && *table_name, FALSE);
-
-	TO_IMPLEMENT;
-	return FALSE;
-}
-
-/**
- * gda_delete_row_from_table
- * @cnn: an opened connection
- * @table_name:
- * @condition_column_name: the name of the column to used in the WHERE condition clause
- * @condition: a GValue to used to find the row to be deleted 
- * @error: a place to store errors, or %NULL
- *
- * This is just a convenient function to delete the row fitting the given condition
- * from the given table.
- *
- * @condition must be a valid GValue and must correspond with the GType of the column to use
- * in the WHERE clause.
- *
- * The SQL command is like: DELETE FROM table_name WHERE contition_column_name = condition
- *
- * Returns: TRUE if no error occurred, and FALSE and set error otherwise
- */
-gboolean              
-gda_delete_row_from_table (GdaConnection *cnn, const gchar *table_name, const gchar *condition_column_name, 
-			   const GValue *condition, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	g_return_val_if_fail (table_name && *table_name, FALSE);
-
-	TO_IMPLEMENT;
-	return FALSE;
-}
-
-/**
- * gda_update_value_in_table
- * @cnn: an opened connection
- * @table_name:
- * @search_for_column: the name of the column to used in the WHERE condition clause
- * @condition: a GValue to used to find the value to be updated; it must correspond with the GType
- * of the column used to search
- * @column_name: the column containing the value to be updated
- * @new_value: the new value to update to; the @GValue must correspond with the GType of the column to update
- * @error: a place to store errors, or %NULL
- * 
- * This is just a convenient function to update values in a table on a given column where
- * the row is fitting the given condition.
- *
- * The SQL command is like: UPDATE INTO table_name SET column_name = new_value WHERE search_for_column = condition
- *
- * Returns: TRUE if no error occurred
- */
-gboolean              
-gda_update_value_in_table (GdaConnection *cnn, 
-			   const gchar *table_name, const gchar *search_for_column, 
-			   const GValue *condition, 
-			   const gchar *column_name, const GValue *new_value, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	g_return_val_if_fail (table_name && *table_name, FALSE);
-
-	TO_IMPLEMENT;
-	return FALSE;
-}
-
-/**
- * gda_update_values_in_table
- * @cnn: an opened connection
- * @table_name: the name of the table where the update will be done
- * @condition_column_name: the name of the column to used in the WHERE condition clause
- * @condition: a GValue to used to find the values to be updated; it must correspond with the
- * column's @GType
- * @error: a place to store errors, or %NULL
- * @...: a list of string/@GValue pairs where the string is the name of the column to be 
- * updated followed by the new @GValue to set, finished by %NULL
- * 
- * This is just a convenient function to update values in a table on a given column where
- * the row is fitting the given condition.
- *
- * The SQL command is like: 
- * UPDATE INTO table_name SET column1 = new_value1, column2 = new_value2 ... WHERE condition_column_name = condition
- *
- * Returns: TRUE if no error occurred
- */
-gboolean              
-gda_update_values_in_table (GdaConnection *cnn, const gchar *table_name, 
-			    const gchar *condition_column_name, const GValue *condition, 
-			    GError **error, ...)
-{
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnn), FALSE);
-	g_return_val_if_fail (gda_connection_is_opened (cnn), FALSE);
-	g_return_val_if_fail (table_name && *table_name, FALSE);
-
-	TO_IMPLEMENT;
-	return FALSE;
-}

Modified: branches/V4-branch/libgda/gda-meta-store.c
==============================================================================
--- branches/V4-branch/libgda/gda-meta-store.c	(original)
+++ branches/V4-branch/libgda/gda-meta-store.c	Thu Feb 21 17:19:02 2008
@@ -23,7 +23,6 @@
 #include <libgda/gda-meta-store.h>
 #include <sql-parser/gda-sql-parser.h>
 #include <sql-parser/gda-sql-statement.h>
-#include <libgda/gda-client.h>
 #include <libgda/gda-connection.h>
 #include <libgda/gda-server-provider.h>
 #include <libgda/gda-data-handler.h>
@@ -538,8 +537,7 @@
 					cnc_string = g_value_get_string (value);
 					if (cnc_string) {
 						GdaConnection *cnc;
-						cnc = gda_client_open_connection_from_string (NULL, NULL, cnc_string,
-											      NULL, 0, NULL);
+						cnc = gda_connection_open_from_string (NULL, cnc_string, NULL, 0, NULL);
 						store->priv->cnc = cnc;
 					}
 				}
@@ -1668,6 +1666,80 @@
 	return store->priv->cnc;
 }
 
+/**
+ * gda_meta_store_extract
+ * @store: a #GdaMetaStore object
+ * @select_sql: a SELECT statement
+ * @error: a place to store errors, or %NULL
+ * @...: a list of (variable name (gchar *), GValue *value) terminated with NULL, representing values for all the
+ * variables mentionned in @select_sql. If there is no variable then this part can be omitted.
+ *
+ * Extracts some data stored in @store using a custom SELECT query.
+ *
+ * Returns: a new #GdaDataModel, or %NULL if an error occurred
+ */
+GdaDataModel *
+gda_meta_store_extract (GdaMetaStore *store, const gchar *select_sql, GError **error, ...)
+{
+	GdaMetaStoreClass *klass;
+	GdaStatement *stmt;
+	const gchar *remain;
+	GdaDataModel *model;
+	GdaSet *params = NULL;
+
+	g_return_val_if_fail (GDA_IS_META_STORE (store), NULL);
+	g_return_val_if_fail (store->priv, NULL);
+
+	/* statement creation */
+	klass = (GdaMetaStoreClass *) G_OBJECT_GET_CLASS (store);
+	stmt = gda_sql_parser_parse_string (klass->cpriv->parser, select_sql, &remain, error);
+	if (!stmt)
+		return NULL;
+	if (remain) {
+		g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_EXTRACT_SQL_ERROR,
+			     _("More than one SQL statement"));
+		g_object_unref (stmt);
+		return NULL;
+	}
+	
+	/* parameters */
+	if (!gda_statement_get_parameters (stmt, &params, error)) {
+		g_object_unref (stmt);
+		return NULL;
+	}
+	if (params) {
+		va_list ap;
+		gchar *pname;
+		va_start (ap, error);
+		for (pname = va_arg (ap, gchar *); pname; pname = va_arg (ap, gchar *)) {
+			GValue *value;
+			GdaHolder *h;
+			value = va_arg (ap, GValue *);
+			h = gda_set_get_holder (params, pname);
+			if (!h)
+				g_warning (_("Parameter '%s' is not present in statement"), pname);
+			else {
+				if (!gda_holder_set_value (h, value)) {
+					g_set_error (error, GDA_META_STORE_ERROR, GDA_META_STORE_EXTRACT_SQL_ERROR,
+						     _("Could not set value of parameter '%s'"), pname);
+					g_object_unref (stmt);
+					g_object_unref (params);
+					va_end (ap);
+					return NULL;
+				}
+			}
+		}
+		va_end (ap);
+	}
+
+	/* execution */
+	model = gda_connection_statement_execute_select (store->priv->cnc, stmt, params, error);
+	g_object_unref (stmt);
+	if (params)
+		g_object_unref (params);
+	return model;
+}
+
 static gboolean prepare_tables_infos (GdaMetaStore *store, TableInfo **out_table_infos, 
 				      TableConditionInfo **out_cond_infos, gboolean *out_with_key,
 				      const gchar *table_name, const gchar *condition, GError **error, 

Modified: branches/V4-branch/libgda/gda-meta-store.h
==============================================================================
--- branches/V4-branch/libgda/gda-meta-store.h	(original)
+++ branches/V4-branch/libgda/gda-meta-store.h	Thu Feb 21 17:19:02 2008
@@ -45,7 +45,8 @@
 	GDA_META_STORE_INCORRECT_SCHEMA,
 	GDA_META_STORE_UNSUPPORTED_PROVIDER,
 	GDA_META_STORE_INTERNAL_ERROR,
-	GDA_META_STORE_MODIFY_CONTENTS_ERROR
+	GDA_META_STORE_MODIFY_CONTENTS_ERROR,
+	GDA_META_STORE_EXTRACT_SQL_ERROR
 } GdaMetaStoreError;
 
 /* 
@@ -96,6 +97,7 @@
 gint              gda_meta_store_get_version              (GdaMetaStore *store);
 
 GdaConnection    *gda_meta_store_get_internal_connection  (GdaMetaStore *store);
+GdaDataModel     *gda_meta_store_extract                  (GdaMetaStore *store, const gchar *select_sql, GError **error, ...);
 
 gboolean          gda_meta_store_modify                   (GdaMetaStore *store, const gchar *table_name, 
 							   GdaDataModel *new_data, const gchar *condition, GError **error, ...);

Modified: branches/V4-branch/libgda/gda-server-provider.c
==============================================================================
--- branches/V4-branch/libgda/gda-server-provider.c	(original)
+++ branches/V4-branch/libgda/gda-server-provider.c	Thu Feb 21 17:19:02 2008
@@ -275,141 +275,6 @@
 }
 
 /**
- * gda_server_provider_create_connection
- * @client: a #GdaClient object to which the returned connection will be attached, or %NULL
- * @provider: a #GdaServerProvider object.
- * @dsn: a DSN string.
- * @params:
- * @auth_string: authentification string
- * @options: options for the connection (see #GdaConnectionOptions).
- *
- * Requests that the @provider creates a new #GdaConnection connection object.
- * See gda_client_open_connection() for more information
- *
- * Returns: a newly-allocated #GdaConnection object, or NULL
- * if it fails.
- */
-GdaConnection *
-gda_server_provider_create_connection (GdaClient *client, GdaServerProvider *provider, 
-				       const gchar *dsn, const gchar *auth_string,
-				       GdaConnectionOptions options)
-{
-	GdaConnection *cnc;
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->create_connection) {
-		cnc = CLASS (provider)->create_connection (provider);
-		if (cnc) {
-			g_object_set (G_OBJECT (cnc), "client", client, "provider_obj", provider, NULL);
-			if (dsn && *dsn)
-				g_object_set (G_OBJECT (cnc), "dsn", dsn, NULL);
-			g_object_set (G_OBJECT (cnc), "auth_string", auth_string, "options", options, NULL);
-		}
-	}
-	else
-		cnc = g_object_new (GDA_TYPE_CONNECTION, "client", client, "provider_obj", provider, 
-				    "dsn", dsn, "auth_string", auth_string, 
-				    "options", options, NULL);
-
-	return cnc;
-}
-
-/**
- * gda_server_provider_create_connection_from_string
- * @client: a #GdaClient object to which the returned connection will be attached, or %NULL
- * @provider: a #GdaServerProvider object.
- * @cnc_string: a connection string.
- * @params:
- * @auth_string: authentification string
- * @options: options for the connection (see #GdaConnectionOptions).
- *
- * Requests that the @provider creates a new #GdaConnection connection object.
- * See gda_client_open_connection() for more information
- *
- * Returns: a newly-allocated #GdaConnection object, or NULL
- * if it fails.
- */
-GdaConnection *
-gda_server_provider_create_connection_from_string (GdaClient *client, GdaServerProvider *provider, 
-						   const gchar *cnc_string, const gchar *auth_string,
-						   GdaConnectionOptions options)
-{
-	GdaConnection *cnc;
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->create_connection) {
-		cnc = CLASS (provider)->create_connection (provider);
-		if (cnc) {
-			g_object_set (G_OBJECT (cnc), "client", client, "provider_obj", provider, NULL);
-			if (cnc_string && *cnc_string)
-				g_object_set (G_OBJECT (cnc), "cnc_string", cnc_string, NULL);
-			g_object_set (G_OBJECT (cnc), "auth_string", auth_string, "options", options, NULL);
-		}
-	}
-	else 
-		cnc = (GdaConnection *) g_object_new (GDA_TYPE_CONNECTION, "client", client, "provider_obj", provider,
-						      "cnc-string", cnc_string, "auth_string", auth_string,
-						      "options", options, NULL);
-
-	return cnc;
-}
-
-/**
- * gda_server_provider_open_connection
- * @provider: a #GdaServerProvider object.
- * @cnc: a #GdaConnection object.
- * @params:
- * @auth: authentification information
- *
- * Tries to open the @cnc connection using methods implemented by @provider. In case of failure,
- * or as a general notice, some #GdaConnectionEvent events (or errors) may be added to the connection
- * during that method, see gda_connection_get_events().
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_open_connection (GdaServerProvider *provider, GdaConnection *cnc,
-				     GdaQuarkList *params, GdaQuarkList *auth)
-{
-	gboolean retcode;
-
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
-	g_return_val_if_fail (CLASS (provider)->open_connection != NULL, FALSE);
-
-	retcode = CLASS (provider)->open_connection (provider, cnc, params, auth, NULL, NULL, NULL);
-
-	return retcode;
-}
-
-
-
-/**
- * gda_server_provider_close_connection
- * @provider: a #GdaServerProvider object.
- * @cnc: a #GdaConnection object.
- *
- * Close the connection.
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_close_connection (GdaServerProvider *provider, GdaConnection *cnc)
-{
-	gboolean retcode;
-
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), FALSE);
-
-	if (CLASS (provider)->close_connection != NULL)
-		retcode = CLASS (provider)->close_connection (provider, cnc);
-	else
-		retcode = TRUE;
-
-	return retcode;
-}
-
-/**
  * gda_server_provider_get_server_version
  * @provider: a #GdaServerProvider object.
  * @cnc: a #GdaConnection object.
@@ -428,29 +293,6 @@
 }
 
 /**
- * gda_server_provider_get_database
- * @provider: a #GdaServerProvider object.
- * @cnc: a #GdaConnection object.
- *
- * Get the database name of the @cnc.
- *
- * Returns: the name of the current database, or %NULL if an error occurred or if the provider
- * does not implement that method.
- */
-const gchar *
-gda_server_provider_get_database (GdaServerProvider *provider,
-				  GdaConnection *cnc)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), NULL);
-	g_return_val_if_fail (GDA_IS_CONNECTION (cnc), NULL);
-
-	if (CLASS (provider)->get_database)
-		return CLASS (provider)->get_database (provider, cnc);
-	else
-		return NULL;
-}
-
-/**
  * gda_server_provider_supports_operation
  * @provider: a #GdaServerProvider object
  * @cnc: a #GdaConnection object which would be used to perform an action, or %NULL
@@ -698,146 +540,6 @@
 }
 
 /**
- * gda_server_provider_begin_transaction
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: the name of the transation to start
- * @level:
- * @error: a place to store errors, or %NULL
- *
- * Starts a new transaction on @cnc.
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_begin_transaction (GdaServerProvider *provider, GdaConnection *cnc,
-				       const gchar *name, GdaTransactionIsolation level,
-				       GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->begin_transaction)
-		return CLASS (provider)->begin_transaction (provider, cnc, name, level, error);
-	else
-		return FALSE;
-}
-
-/**
- * gda_server_provider_commit_transaction
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: the name of the transation to commit
- * @error: a place to store errors, or %NULL
- *
- * Commit the current transaction
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_commit_transaction (GdaServerProvider *provider, GdaConnection *cnc,
-					const gchar *name, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->commit_transaction)
-		return CLASS (provider)->commit_transaction (provider, cnc, name, error);
-	else
-		return FALSE;
-}
-
-/**
- * gda_server_provider_rollback_transaction
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: the name of the transation to commit
- * @error: a place to store errors, or %NULL
- *
- * Rolls back the current transaction
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_rollback_transaction (GdaServerProvider *provider, GdaConnection *cnc,
-					  const gchar *name, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->rollback_transaction)
-		return CLASS (provider)->rollback_transaction (provider, cnc, name, error);
-	else
-		return FALSE;
-}
-
-/**
- * gda_server_provider_add_savepoint
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: name of the savepoint to add
- * @error: a place to store errors or %NULL
- *
- * Add a savepoint within the current transaction
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_add_savepoint (GdaServerProvider *provider, GdaConnection *cnc, 
-				   const gchar *name, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-	
-	if (CLASS (provider)->add_savepoint)
-		return CLASS (provider)->add_savepoint (provider, cnc, name, error);
-	else
-		return FALSE;
-}
-
-/**
- * gda_server_provider_rollback_savepoint
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: name of the savepoint to rollback to
- * @error: a place to store errors or %NULL
- *
- * Rolls back to a savepoint within the current transaction
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_rollback_savepoint (GdaServerProvider *provider, GdaConnection *cnc, 
-					const gchar *name, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->rollback_savepoint)
-		return CLASS (provider)->rollback_savepoint (provider, cnc, name, error);
-	else
-		return FALSE;
-}
-
-/**
- * gda_server_provider_delete_savepoint
- * @provider: a #GdaServerProvider object
- * @cnc: a #GdaConnection object
- * @name: name of the savepoint to delete
- * @error: a place to store errors or %NULL
- *
- * Delete a savepoint within the current transaction
- *
- * Returns: TRUE if no error occurred
- */
-gboolean
-gda_server_provider_delete_savepoint (GdaServerProvider *provider, GdaConnection *cnc, 
-				      const gchar *name, GError **error)
-{
-	g_return_val_if_fail (GDA_IS_SERVER_PROVIDER (provider), FALSE);
-
-	if (CLASS (provider)->delete_savepoint)
-		return CLASS (provider)->delete_savepoint (provider, cnc, name, error);
-	else
-		return FALSE;
-}
-
-/**
  * gda_server_provider_supports_feature
  * @provider: a #GdaServerProvider object
  * @cnc: a #GdaConnection object, or %NULL

Modified: branches/V4-branch/libgda/gda-server-provider.h
==============================================================================
--- branches/V4-branch/libgda/gda-server-provider.h	(original)
+++ branches/V4-branch/libgda/gda-server-provider.h	Thu Feb 21 17:19:02 2008
@@ -30,7 +30,6 @@
 #include <libgda/gda-data-model.h>
 #include <libgda/gda-data-model-index.h>
 #include <libgda/gda-quark-list.h>
-#include <libgda/gda-client.h>
 #include <libgda/gda-statement.h>
 #include <libgda/gda-meta-store.h>
 
@@ -147,8 +146,9 @@
 							  gpointer cb_data, GError **error);
 
 	/* Misc */
-	gboolean                (* is_busy)              (GdaServerProvider *provider, GdaConnection *cnc);
-	gboolean                (* cancel)               (GdaServerProvider *provider, GdaConnection *cnc, guint task_id);
+	gboolean                (* is_busy)              (GdaServerProvider *provider, GdaConnection *cnc, GError **error);
+	gboolean                (* cancel)               (GdaServerProvider *provider, GdaConnection *cnc, 
+							  guint task_id, GError **error);
 	GdaConnection          *(* create_connection)    (GdaServerProvider *provider);
 	GdaServerProviderMeta      meta_funcs;
 
@@ -193,22 +193,6 @@
 gchar                 *gda_server_provider_unescape_string       (GdaServerProvider *provider,
 								  GdaConnection *cnc, const gchar *str);
 
-/* connections management */
-GdaConnection         *gda_server_provider_create_connection (GdaClient *client, GdaServerProvider *provider, 
-							      const gchar *dsn, const gchar *auth_string,
-							      GdaConnectionOptions options);
-GdaConnection         *gda_server_provider_create_connection_from_string (GdaClient *client, GdaServerProvider *provider, 
-									  const gchar *cnc_string, const gchar *auth_string,
-									  GdaConnectionOptions options);
-gboolean               gda_server_provider_open_connection  (GdaServerProvider *provider, GdaConnection *cnc,
-							     GdaQuarkList *params, GdaQuarkList *auth);
-
-gboolean               gda_server_provider_close_connection (GdaServerProvider *provider,
-							     GdaConnection *cnc);
-
-const gchar           *gda_server_provider_get_database     (GdaServerProvider *provider,
-							     GdaConnection *cnc);
-
 /* actions with parameters */
 gboolean               gda_server_provider_supports_operation (GdaServerProvider *provider, GdaConnection *cnc, 
 							       GdaServerOperationType type, GdaSet *options);
@@ -221,26 +205,7 @@
 							       GdaServerOperation *op, GError **error);
 
 /* GdaStatement */
-GdaSqlParser *gda_server_provider_create_parser     (GdaServerProvider *provider, GdaConnection *cnc);
-
-
-/* transactions */
-gboolean      gda_server_provider_begin_transaction    (GdaServerProvider *provider,
-							GdaConnection *cnc,
-							const gchar *name, GdaTransactionIsolation level,
-							GError **error);
-gboolean      gda_server_provider_commit_transaction   (GdaServerProvider *provider,
-							GdaConnection *cnc,
-							const gchar *name, GError **error);
-gboolean      gda_server_provider_rollback_transaction (GdaServerProvider *provider,
-							GdaConnection *cnc,
-							const gchar *name, GError **error);
-gboolean      gda_server_provider_add_savepoint        (GdaServerProvider *provider, GdaConnection *cnc, 
-							const gchar *name, GError **error);
-gboolean      gda_server_provider_rollback_savepoint   (GdaServerProvider *provider, GdaConnection *cnc, 
-							const gchar *name, GError **error);
-gboolean      gda_server_provider_delete_savepoint     (GdaServerProvider *provider, GdaConnection *cnc, 
-							const gchar *name, GError **error);
+GdaSqlParser          *gda_server_provider_create_parser      (GdaServerProvider *provider, GdaConnection *cnc);
 
 G_END_DECLS
 

Modified: branches/V4-branch/libgda/libgda.h.in
==============================================================================
--- branches/V4-branch/libgda/libgda.h.in	(original)
+++ branches/V4-branch/libgda/libgda.h.in	Thu Feb 21 17:19:02 2008
@@ -26,7 +26,7 @@
 #ifndef __LIBGDA_H__
 #define __LIBGDA_H__
 
-#include <libgda/gda-client.h>
+#include <libgda/gda-easy.h>
 #include <libgda/gda-column-index.h>
 #include <libgda/gda-column.h>
 #include <libgda/gda-config.h>
@@ -74,60 +74,12 @@
 
 G_BEGIN_DECLS
 
-extern GQuark gda_general_error_quark (void);
-#define GDA_GENERAL_ERROR gda_general_error_quark ()
-
-typedef enum  {
-    GDA_GENERAL_OBJECT_NAME_ERROR,
-    GDA_GENERAL_INCORRECT_VALUE_ERROR,
-    GDA_GENERAL_OPERATION_ERROR
-} GdaGeneralError;
-
 void     gda_init             (const gchar *app_id, const gchar *version, gint nargs, gchar *args[]);
 
 typedef  void (* GdaInitFunc) (gpointer user_data);
 void     gda_main_run         (GdaInitFunc init_func, gpointer user_data);
 void     gda_main_quit        (void);
 
-/* Convenient Functions */
-GdaDataHandler     *gda_get_default_handler    (GType for_type);
-GdaConnection      *gda_open_connection        (const gchar *dsn, 
-						const gchar *username, 
-						const gchar *password, 
-						GdaConnectionOptions options, 
-						GError **error);
-
-gboolean            gda_insert_row_into_table  (GdaConnection *cnn, 
-						const gchar *table_name, 
-						GError **error, ...);
-gboolean            gda_insert_row_into_table_from_string  (GdaConnection *cnn, 
-						const gchar *table_name, 
-						GError **error, ...);
-gboolean            gda_update_value_in_table  (GdaConnection *cnn, 
-						const gchar *table_name, 
-						const gchar *search_for_column, 
-						const GValue *condition, 
-						const gchar *column_name, 
-						const GValue *new_value, GError **error);
-gboolean            gda_update_values_in_table (GdaConnection *cnn, 
-						const gchar *table_name, 
-						const gchar *condition_column_name, 
-						const GValue *condition, 
-						GError **error, ...);
-gboolean            gda_delete_row_from_table (GdaConnection *cnn, const gchar *table_name, 
-					       const gchar *condition_column_name, const GValue *condition, 
-					       GError **error);
-
-GdaDataModel*       gda_execute_select_command (GdaConnection *cnn, const gchar *sql, 
-						GError **error);
-gint                gda_execute_sql_command    (GdaConnection *cnn, const gchar *sql, 
-						GError **error);
-
-gboolean            gda_create_table           (GdaConnection *cnn, 
-						const gchar *table_name, GError **error, ...);
-gboolean            gda_drop_table             (GdaConnection *cnn, 
-						const gchar *table_name, GError **error);
-
 G_END_DECLS
 
 #endif

Modified: branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.c
==============================================================================
--- branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.c	(original)
+++ branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.c	Thu Feb 21 17:19:02 2008
@@ -28,6 +28,7 @@
 
 #define PARENT_TYPE GDA_TYPE_CONNECTION
 #define CLASS(obj) (GDA_VIRTUAL_CONNECTION_CLASS (G_OBJECT_GET_CLASS (obj)))
+#define PROV_CLASS(provider) (GDA_SERVER_PROVIDER_CLASS (G_OBJECT_GET_CLASS (provider)))
 
 struct _GdaVirtualConnectionPrivate {
 	gpointer              v_provider_data;
@@ -116,6 +117,37 @@
 }
 
 /**
+ * gda_virtual_connection_open
+ * @virtual_provider: a #GdaVirtualProvider object
+ * @error: a place to store errors, or %NULL
+ *
+ * Creates and opens a new virtual connection using the @virtual_provider provider
+ *
+ * Returns: a new #GdaConnection object, or %NULL if an error occurred
+ */
+GdaConnection *
+gda_virtual_connection_open (GdaVirtualProvider *virtual_provider, GError **error)
+{
+	GdaConnection *cnc = NULL;
+	g_return_val_if_fail (GDA_IS_VIRTUAL_PROVIDER (virtual_provider), NULL);
+
+	if (PROV_CLASS (virtual_provider)->create_connection) {
+		cnc = PROV_CLASS (virtual_provider)->create_connection (virtual_provider);
+		if (cnc) {
+			g_object_set (G_OBJECT (cnc), "provider_obj", virtual_provider, NULL);
+			if (!gda_connection_open (cnc, error)) {
+				g_object_unref (cnc);
+				cnc = NULL;
+			}
+		}
+	}
+	else
+		g_set_error (error, GDA_CONNECTION_ERROR, GDA_CONNECTION_PROVIDER_ERROR,
+			     _("Internal error: virtual provider does not implement the create_operation() virtual method"));
+	return cnc;
+}
+
+/**
  * gda_virtual_connection_internal_set_provider_data
  * @vcnc: a #GdaConnection object
  * @data: an opaque structure, known only to the provider for which @vcnc is opened

Modified: branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.h
==============================================================================
--- branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.h	(original)
+++ branches/V4-branch/libgda/sqlite/virtual/gda-virtual-connection.h	Thu Feb 21 17:19:02 2008
@@ -24,6 +24,7 @@
 #define __GDA_VIRTUAL_CONNECTION_H__
 
 #include <libgda/gda-connection.h>
+#include <virtual/gda-virtual-provider.h>
 
 #define GDA_TYPE_VIRTUAL_CONNECTION            (gda_virtual_connection_get_type())
 #define GDA_VIRTUAL_CONNECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST (obj, GDA_TYPE_VIRTUAL_CONNECTION, GdaVirtualConnection))
@@ -46,10 +47,11 @@
 	GdaConnectionClass           parent_class;
 };
 
-GType      gda_virtual_connection_get_type                   (void) G_GNUC_CONST;
-void       gda_virtual_connection_internal_set_provider_data (GdaVirtualConnection *vcnc, 
-							      gpointer data, GDestroyNotify destroy_func);
-gpointer   gda_virtual_connection_internal_get_provider_data (GdaVirtualConnection *cnc);
+GType          gda_virtual_connection_get_type                   (void) G_GNUC_CONST;
+GdaConnection *gda_virtual_connection_open                       (GdaVirtualProvider *virtual_provider, GError **error);
+void           gda_virtual_connection_internal_set_provider_data (GdaVirtualConnection *vcnc, 
+								  gpointer data, GDestroyNotify destroy_func);
+gpointer       gda_virtual_connection_internal_get_provider_data (GdaVirtualConnection *cnc);
 
 G_END_DECLS
 

Modified: branches/V4-branch/libgda/sqlite/virtual/virtual-test.c
==============================================================================
--- branches/V4-branch/libgda/sqlite/virtual/virtual-test.c	(original)
+++ branches/V4-branch/libgda/sqlite/virtual/virtual-test.c	Thu Feb 21 17:19:02 2008
@@ -1,9 +1,13 @@
 #include <libgda/libgda.h>
 #include <gda-vprovider-data-model.h>
 #include <gda-vconnection-data-model.h>
+#include <sql-parser/gda-sql-parser.h>
+
 static gboolean test_sql_select (GdaConnection *cnc, const gchar *sql);
 static gboolean test_sql_non_select (GdaConnection *cnc, const gchar *sql);
 
+GdaSqlParser *parser;
+
 int 
 main (int argc, char **argv)
 {
@@ -15,10 +19,11 @@
 	
 	gda_init ("SQlite virtual providers test", PACKAGE_VERSION, argc, argv);
 
+	parser = gda_sql_parser_new ();
+
 	provider = gda_vprovider_data_model_new ();
-	cnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
+	cnc = gda_virtual_connection_open (provider, NULL);
 	g_assert (GDA_IS_VCONNECTION_DATA_MODEL (cnc));
-	gda_connection_open (cnc, NULL);
 
 	g_print ("Connection status for %s: %s\n", G_OBJECT_TYPE_NAME (cnc), 
 		 gda_connection_is_opened (cnc) ? "Opened" : "Closed");
@@ -162,14 +167,15 @@
 static gboolean
 test_sql_select (GdaConnection *cnc, const gchar *sql)
 {
-	GdaCommand *command;
+	GdaStatement *stmt;
 	GdaDataModel *data;
 	GError *error = NULL; 
 
 	g_print ("\n\n============== SQL: %s\n", sql);
-	command = gda_command_new (sql, GDA_COMMAND_TYPE_SQL, 0);
-	data = gda_connection_execute_select_command (cnc, command, NULL, &error);
-	gda_command_free (command);
+	stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+	g_assert (stmt);
+	data = gda_connection_statement_execute_select (cnc, stmt, NULL, &error);
+	g_object_unref (stmt);
 	if (data) {
 		gda_data_model_dump (data, stdout);
 		g_object_unref (data);
@@ -186,14 +192,15 @@
 static gboolean
 test_sql_non_select (GdaConnection *cnc, const gchar *sql)
 {
-	GdaCommand *command;
+	GdaStatement *stmt;
 	GError *error = NULL; 
 	gint nrows;
 
 	g_print ("\n\n============== SQL: %s\n", sql);
-	command = gda_command_new (sql, GDA_COMMAND_TYPE_SQL, 0);
-	nrows = gda_connection_execute_non_select_command (cnc, command, NULL, &error);
-	gda_command_free (command);
+	stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+	g_assert (stmt);
+	nrows = gda_connection_statement_execute_non_select (cnc, stmt, NULL, NULL, &error);
+	g_object_unref (stmt);
 	if (nrows == -1) {
 		g_print ("NON SELECT error: %s\n", error && error->message ? error->message : "no detail");
 		g_error_free (error);

Modified: branches/V4-branch/providers/bdb/gda-bdb-test.c
==============================================================================
--- branches/V4-branch/providers/bdb/gda-bdb-test.c	(original)
+++ branches/V4-branch/providers/bdb/gda-bdb-test.c	Thu Feb 21 17:19:02 2008
@@ -60,7 +60,6 @@
 gda_stuff (gpointer filename)
 {
 	gchar *cncstring;
-	GdaClient *client;
 	GdaConnection *cnc;
 	GdaDataModel *model;
 	GError *error = NULL;
@@ -72,9 +71,7 @@
 	cncstring = g_strdup_printf ("DB_NAME=%s", (gchar *) filename);
 
 	/* connect to the db */
-	client = gda_client_new ();
-	g_assert (client != NULL);
-	cnc = gda_client_open_connection_from_string (client, "Berkeley-DB", cncstring, NULL, 0, &error);
+	cnc = gda_connection_open_from_string ("Berkeley-DB", cncstring, NULL, 0, &error);
 	if (!cnc) {
 		g_print ("Could not open connection; %s\n", error && error->message ? error->message : "no detail");
 		exit (1);

Modified: branches/V4-branch/providers/postgres/gda-postgres-ddl.c
==============================================================================
--- branches/V4-branch/providers/postgres/gda-postgres-ddl.c	(original)
+++ branches/V4-branch/providers/postgres/gda-postgres-ddl.c	Thu Feb 21 17:19:02 2008
@@ -76,9 +76,14 @@
 			value = gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_NAME/%d", i);
 			g_string_append (string, g_value_get_string (value));
 			g_string_append_c (string, ' ');
-				
-			value = gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_TYPE/%d", i);
-			g_string_append (string, g_value_get_string (value));
+			
+			value = gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_AUTOINC/%d", i);
+			if (value)
+				g_string_append (string, "serial");
+			else {
+				value = gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_TYPE/%d", i);
+				g_string_append (string, g_value_get_string (value));
+			}
 				
 			value = gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_DEFAULT/%d", i);
 			if (value && G_VALUE_HOLDS (value, G_TYPE_STRING)) {

Modified: branches/V4-branch/providers/postgres/gda-postgres-meta.c
==============================================================================
--- branches/V4-branch/providers/postgres/gda-postgres-meta.c	(original)
+++ branches/V4-branch/providers/postgres/gda-postgres-meta.c	Thu Feb 21 17:19:02 2008
@@ -41,7 +41,9 @@
 typedef enum {
         I_STMT_CATALOG,
 	I_STMT_BTYPES,
-	I_STMT_SCHEMATA
+	I_STMT_SCHEMATA,
+	I_STMT_TABLES,
+	I_STMT_VIEWS,
 } InternalStatementItem;
 
 
@@ -51,7 +53,9 @@
 static gchar *internal_sql[] = {
 	"SELECT pg_catalog.current_database()",
 	"SELECT t.typname, 'pg_catalog.' || t.typname, 'gchararray', pg_catalog.obj_description(t.oid), NULL, CASE WHEN t.typname ~ '^_' THEN TRUE WHEN typtype = 'p' THEN TRUE WHEN t.typname in ('any', 'anyarray', 'anyelement', 'cid', 'cstring', 'int2vector', 'internal', 'language_handler', 'oidvector', 'opaque', 'record', 'refcursor', 'regclass', 'regoper', 'regoperator', 'regproc', 'regprocedure', 'regtype', 'SET', 'smgr', 'tid', 'trigger', 'unknown', 'void', 'xid', 'oid', 'aclitem') THEN TRUE ELSE FALSE END, CAST (t.oid AS int8) FROM pg_catalog.pg_type t, pg_catalog.pg_user u, pg_catalog.pg_namespace n WHERE t.typowner=u.usesysid AND n.oid = t.typnamespace AND pg_catalog.pg_type_is_visible(t.oid) AND (typtype='b' OR typtype='p')",
-	"SELECT catalog_name, schema_name, schema_owner, CASE WHEN schema_name ~'^pg_' THEN TRUE WHEN schema_name ='information_schema' THEN TRUE ELSE FALSE END FROM information_schema.schemata"
+	"SELECT catalog_name, schema_name, schema_owner, CASE WHEN schema_name ~'^pg_' THEN TRUE WHEN schema_name ='information_schema' THEN TRUE ELSE FALSE END FROM information_schema.schemata",
+	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, CASE WHEN nc.oid = pg_my_temp_schema() THEN 'LOCAL TEMPORARY'::text WHEN c.relkind = 'r' THEN 'BASE TABLE' WHEN c.relkind = 'v' THEN 'VIEW' ELSE NULL::text END::information_schema.character_data AS table_type, CASE WHEN c.relkind = 'r' THEN TRUE ELSE FALSE END, pg_catalog.obj_description(c.oid), CASE WHEN pg_catalog.pg_table_is_visible(c.oid) IS TRUE AND nc.nspname!='pg_catalog' THEN c.relname ELSE coalesce (nc.nspname || '.', '') || c.relname END, coalesce (nc.nspname || '.', '') || c.relname, o.rolname FROM pg_namespace nc, pg_class c, pg_authid o WHERE c.relnamespace = nc.oid AND (c.relkind = ANY (ARRAY['r', 'v'])) AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid,
  'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text)) AND o.oid=c.relowner",
+	"SELECT current_database()::information_schema.sql_identifier AS table_catalog, nc.nspname::information_schema.sql_identifier AS table_schema, c.relname::information_schema.sql_identifier AS table_name, pg_catalog.pg_get_viewdef(c.oid, TRUE), NULL, CASE WHEN c.relkind = 'r'::\"char\" THEN TRUE ELSE FALSE END FROM pg_namespace nc, pg_class c WHERE c.relnamespace = nc.oid AND c.relkind = 'v' AND NOT pg_is_other_temp_schema(nc.oid) AND (pg_has_role(c.relowner, 'USAGE'::text) OR has_table_privilege(c.oid, 'SELECT'::text) OR has_table_privilege(c.oid, 'INSERT'::text) OR has_table_privilege(c.oid, 'UPDATE'::text) OR has_table_privilege(c.oid, 'DELETE'::text) OR has_table_privilege(c.oid, 'REFERENCES'::text) OR has_table_privilege(c.oid, 'TRIGGER'::text))"
 };
 
 /*
@@ -182,17 +186,31 @@
 _gda_postgres_meta_tables_views (GdaServerProvider *prov, GdaConnection *cnc, 
 				 GdaMetaStore *store, GdaMetaContext *context, GError **error)
 {
-	GdaDataModel *model;
+	GdaDataModel *tables_model, *views_model;
 	gboolean retval = TRUE;
 
-	model = gda_meta_store_create_modify_data_model (store, context->table_name);
-	g_assert (model);
+	tables_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_TABLES], NULL, error);
+	if (!tables_model)
+		return FALSE;
+	views_model = gda_connection_statement_execute_select (cnc, internal_stmt[I_STMT_VIEWS], NULL, error);
+	if (!views_model) {
+		g_object_unref (tables_model);
+		return FALSE;
+	}
+
+	GdaMetaContext c2;
+	c2 = *context; /* copy contents, just because we need to modify @context->table_name */
+	if (retval) {
+		c2.table_name = "_tables";
+		retval = gda_meta_store_modify_with_context (store, &c2, tables_model, error);
+	}
+	if (retval) {
+		c2.table_name = "_views";
+		retval = gda_meta_store_modify_with_context (store, &c2, views_model, error);
+	}
+	g_object_unref (tables_model);
+	g_object_unref (views_model);
 
-	/* fill in @model */
-	TO_IMPLEMENT;
-	if (retval)
-		retval = gda_meta_store_modify (store, context->table_name, model, NULL, error, NULL);
-	g_object_unref (model);
 
 	return retval;
 }

Modified: branches/V4-branch/providers/postgres/gda-postgres-provider.c
==============================================================================
--- branches/V4-branch/providers/postgres/gda-postgres-provider.c	(original)
+++ branches/V4-branch/providers/postgres/gda-postgres-provider.c	Thu Feb 21 17:19:02 2008
@@ -1950,6 +1950,23 @@
 
 	if (cdata->pconn)
                 PQfinish (cdata->pconn);
-	TO_IMPLEMENT;
+
+	if (cdata->type_data) {
+		gint i;
+		for (i = 0; i < cdata->ntypes; i++) {
+			g_free (cdata->type_data[i].name);
+			g_free (cdata->type_data[i].comments);
+			g_free (cdata->type_data[i].owner);
+		}
+		g_free (cdata->type_data);
+	}
+	
+	if (cdata->h_table)
+		g_hash_table_destroy (cdata->h_table);
+	
+	g_free (cdata->version);
+	g_free (cdata->avoid_types_oids);
+	g_free (cdata->any_type_oid);
+
 	g_free (cdata);
 }

Modified: branches/V4-branch/providers/postgres/postgres_specs_create_table.xml.in
==============================================================================
--- branches/V4-branch/providers/postgres/postgres_specs_create_table.xml.in	(original)
+++ branches/V4-branch/providers/postgres/postgres_specs_create_table.xml.in	Thu Feb 21 17:19:02 2008
@@ -33,6 +33,7 @@
     <gda_array_field id="COLUMN_SIZE" _name="Size" gdatype="guint"/>
     <gda_array_field id="COLUMN_SCALE" _name="Scale" gdatype="guint"/>
     <gda_array_field id="COLUMN_NNUL" _name="Not NULL" gdatype="gboolean"/>
+    <gda_array_field id="COLUMN_AUTOINC" _name="Auto increment" gdatype="gboolean"/>
     <gda_array_field id="COLUMN_UNIQUE" _name="Unique" gdatype="gboolean"/>
     <gda_array_field id="COLUMN_PKEY" _name="Primary key" gdatype="gboolean"/>
     <gda_array_field id="COLUMN_DEFAULT" _name="Default" _descr="Default value" gdatype="gchararray"/>
@@ -43,8 +44,9 @@
             <gda_value>serial</gda_value>
             <gda_value></gda_value>
             <gda_value></gda_value>
-            <gda_value>FALSE</gda_value>
-            <gda_value>FALSE</gda_value>
+            <gda_value>TRUE</gda_value>
+	    <gda_value>TRUE</gda_value>
+            <gda_value>TRUE</gda_value>
             <gda_value>TRUE</gda_value>
             <gda_value></gda_value>
             <gda_value></gda_value>

Modified: branches/V4-branch/samples/DDL/ddl.c
==============================================================================
--- branches/V4-branch/samples/DDL/ddl.c	(original)
+++ branches/V4-branch/samples/DDL/ddl.c	Thu Feb 21 17:19:02 2008
@@ -1,7 +1,7 @@
 #include <libgda/libgda.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 void display_products_contents (GdaConnection *cnc);
 void create_table (GdaConnection *cnc);
 
@@ -10,14 +10,10 @@
 {
         gda_init ("SimpleExample", "1.0", argc, argv);
 
-        GdaClient *client;
         GdaConnection *cnc;
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open connections */
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	create_table (cnc);
 	display_products_contents (cnc);
         gda_connection_close (cnc);
@@ -29,13 +25,13 @@
  * Open a connection to the example.db file
  */
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection (void)
 {
         GdaConnection *cnc;
         GError *error = NULL;
-        cnc = gda_client_open_connection_from_string (client, "SQLite", "DB_DIR=.;DB_NAME=ddl_db", NULL, NULL,
-						      GDA_CONNECTION_OPTIONS_DONT_SHARE,
-						      &error);
+        cnc = gda_connection_open_from_string ("SQLite", "DB_DIR=.;DB_NAME=ddl_db", NULL, NULL,
+					       GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					       &error);
         if (!cnc) {
                 g_print ("Could not open connection to SQLite database in example_db.db file: %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/DirDataModel/find-duplicates.c
==============================================================================
--- branches/V4-branch/samples/DirDataModel/find-duplicates.c	(original)
+++ branches/V4-branch/samples/DirDataModel/find-duplicates.c	Thu Feb 21 17:19:02 2008
@@ -97,8 +97,7 @@
 
 	/* set up virtual environment */
 	provider = gda_vprovider_data_model_new ();
-        cnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
-        g_assert (gda_connection_open (cnc, NULL));
+        cnc = gda_virtual_connection_open (provider, NULL);
 
 	model = gda_data_model_dir_new (dirname);
 	g_print ("Finding duplicates among %d files\n", gda_data_model_get_n_rows (model));

Modified: branches/V4-branch/samples/F-Spot/repair-path.c
==============================================================================
--- branches/V4-branch/samples/F-Spot/repair-path.c	(original)
+++ branches/V4-branch/samples/F-Spot/repair-path.c	Thu Feb 21 17:19:02 2008
@@ -25,7 +25,6 @@
 int
 main (int argc, char *argv [])
 {
-	GdaClient *client;
 	GOptionContext *context;
 	GdaDataModel *dir_model;
 	GError *error = NULL;
@@ -78,9 +77,8 @@
 	cnc_string = g_strdup_printf ("DB_DIR=%s;DB_NAME=%s", cnc_dir_name, cnc_db_name);
 
 	/* open connection */
-	client = gda_client_new ();
-	cnc = gda_client_open_connection_from_string (client, "SQLite", cnc_string, NULL, NULL, 
-						      GDA_CONNECTION_OPTIONS_READ_ONLY, &error);
+	cnc = gda_connection_open_from_string ("SQLite", cnc_string, NULL, NULL, 
+					       GDA_CONNECTION_OPTIONS_READ_ONLY, &error);
 	if (!cnc) {
 		g_print ("Could not open connection to F-Spot database file: %s\n", 
 			 error && error->message ? error->message : "No detail");
@@ -97,8 +95,9 @@
 
 	/* Set up Connection hub */
         provider = gda_vprovider_hub_new ();
-        hub = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
-        g_assert (gda_connection_open (hub, NULL));
+        hub = gda_virtual_connection (provider, NULL);
+        g_assert (hub);
+
 	if (!gda_vconnection_hub_add (GDA_VCONNECTION_HUB (hub), cnc, "spot", &error)) {
 		g_print ("Could not add F-Spot connection to hub: %s\n", 
 			 error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/Report/customers-report-docbook.c
==============================================================================
--- branches/V4-branch/samples/Report/customers-report-docbook.c	(original)
+++ branches/V4-branch/samples/Report/customers-report-docbook.c	Thu Feb 21 17:19:02 2008
@@ -2,14 +2,13 @@
 #include <libgda-report/libgda-report.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 GSList        *create_queries (GdaConnection *cnc);
 
 int 
 main (int argc, char **argv)
 {
 	GdaReportEngine *eng;
-	GdaClient *client;
 	GdaConnection *cnc;
 	GdaHolder *param;
 	GdaReportDocument *doc;
@@ -23,8 +22,7 @@
 	g_object_set (G_OBJECT (doc), "fo-stylesheet", "/usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl", NULL);
 	
 	/* GdaConnection */
-	client = gda_client_new ();
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	gda_report_engine_declare_object (eng, G_OBJECT (cnc), "main_cnc");
 
 	/* define parameters */
@@ -71,13 +69,13 @@
 }
 
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection (void)
 {
         GdaConnection *cnc;
         GError *error = NULL;
-        cnc = gda_client_open_connection (client, "SalesTest", NULL, NULL,
-                                          GDA_CONNECTION_OPTIONS_DONT_SHARE,
-                                          &error);
+        cnc = gda_connection_open_from_dsn (client, "SalesTest", NULL, NULL,
+					    GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					    &error);
         if (!cnc) {
                 g_print ("Could not open connection to DSN 'SalesTest': %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/Report/customers-report-rml.c
==============================================================================
--- branches/V4-branch/samples/Report/customers-report-rml.c	(original)
+++ branches/V4-branch/samples/Report/customers-report-rml.c	Thu Feb 21 17:19:02 2008
@@ -2,14 +2,13 @@
 #include <libgda-report/libgda-report.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 GSList        *create_queries (GdaConnection *cnc);
 
 int 
 main (int argc, char **argv)
 {
 	GdaReportEngine *eng;
-	GdaClient *client;
 	GdaConnection *cnc;
 	GdaHolder *param;
 	GdaReportDocument *doc;
@@ -22,8 +21,7 @@
 	gda_report_document_set_template (doc, "customers-report-rml.rml");
 	
 	/* GdaConnection */
-	client = gda_client_new ();
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	gda_report_engine_declare_object (eng, G_OBJECT (cnc), "main_cnc");
 
 	/* define parameters */
@@ -70,13 +68,13 @@
 }
 
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection (void)
 {
         GdaConnection *cnc;
         GError *error = NULL;
-        cnc = gda_client_open_connection (client, "SalesTest", NULL, NULL,
-                                          GDA_CONNECTION_OPTIONS_DONT_SHARE,
-                                          &error);
+        cnc = gda_connection_open_from_dsn ("SalesTest", NULL, NULL,
+					    GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					    &error);
         if (!cnc) {
                 g_print ("Could not open connection to DSN 'SalesTest': %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/Report/customers-report.c
==============================================================================
--- branches/V4-branch/samples/Report/customers-report.c	(original)
+++ branches/V4-branch/samples/Report/customers-report.c	Thu Feb 21 17:19:02 2008
@@ -2,7 +2,7 @@
 #include <gda-report-engine.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 GSList        *create_queries (GdaConnection *cnc);
 
 int 
@@ -10,7 +10,6 @@
 {
 	gchar *spec;
 	GdaReportEngine *eng;
-	GdaClient *client;
 	GdaConnection *cnc;
 	GdaHolder *param;
 
@@ -22,8 +21,7 @@
 	g_free (spec);
 
 	/* GdaConnection */
-	client = gda_client_new ();
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	gda_report_engine_declare_object (eng, G_OBJECT (cnc), "main_cnc");
 
 	/* define parameters */
@@ -62,13 +60,13 @@
 }
 
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection (void)
 {
         GdaConnection *cnc;
         GError *error = NULL;
-        cnc = gda_client_open_connection (client, "SalesTest", NULL, NULL,
-                                          GDA_CONNECTION_OPTIONS_DONT_SHARE,
-                                          &error);
+        cnc = gda_connection_open_from_dsn ("SalesTest", NULL, NULL,
+					    GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					    &error);
         if (!cnc) {
                 g_print ("Could not open connection to DSN 'SalesTest': %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/SimpleExample/example.c
==============================================================================
--- branches/V4-branch/samples/SimpleExample/example.c	(original)
+++ branches/V4-branch/samples/SimpleExample/example.c	Thu Feb 21 17:19:02 2008
@@ -1,7 +1,7 @@
 #include <libgda/libgda.h>
 #include <sql-parser/gda-sql-parser.h>
 
-GdaConnection *open_connection (GdaClient *client);
+GdaConnection *open_connection (void);
 void display_products_contents (GdaConnection *cnc);
 void create_table (GdaConnection *cnc);
 void run_sql_non_select (GdaConnection *cnc, const gchar *sql);
@@ -11,14 +11,10 @@
 {
         gda_init ("SimpleExample", "1.0", argc, argv);
 
-        GdaClient *client;
         GdaConnection *cnc;
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open connections */
-	cnc = open_connection (client);
+	cnc = open_connection ();
 	create_table (cnc);
 	display_products_contents (cnc);
         gda_connection_close (cnc);
@@ -30,16 +26,16 @@
  * Open a connection to the example.db file
  */
 GdaConnection *
-open_connection (GdaClient *client)
+open_connection ()
 {
         GdaConnection *cnc;
         GError *error = NULL;
 	GdaSqlParser *parser;
 
 	/* open connection */
-        cnc = gda_client_open_connection_from_string (client, "SQLite", "DB_DIR=.;DB_NAME=example_db", NULL, NULL,
-						      GDA_CONNECTION_OPTIONS_DONT_SHARE,
-						      &error);
+        cnc = gda_connection_open_from_string ("SQLite", "DB_DIR=.;DB_NAME=example_db", NULL, NULL,
+					       GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					       &error);
         if (!cnc) {
                 g_print ("Could not open connection to SQLite database in example_db.db file: %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/TableCopy/common.c
==============================================================================
--- branches/V4-branch/samples/TableCopy/common.c	(original)
+++ branches/V4-branch/samples/TableCopy/common.c	Thu Feb 21 17:19:02 2008
@@ -3,13 +3,13 @@
 #include <sql-parser/gda-sql-parser.h>
 
 GdaConnection *
-open_source_connection (GdaClient *client)
+open_source_connection (void)
 {
 	GdaConnection *cnc;
 	GError *error = NULL;
-	cnc = gda_client_open_connection (client, "SalesTest", NULL, NULL,
-                                          GDA_CONNECTION_OPTIONS_DONT_SHARE,
-                                          &error);
+	cnc = gda_connection_open_from_dsn ("SalesTest", NULL, NULL,
+					    GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					    &error);
         if (!cnc) {
                 g_print ("Could not open connection to DSN 'SalesTest': %s\n",
                          error && error->message ? error->message : "No detail");
@@ -19,15 +19,15 @@
 }
 
 GdaConnection *
-open_destination_connection (GdaClient *client)
+open_destination_connection (void)
 {
 	/* create connection */
 	GdaConnection *cnc;
 	GError *error = NULL;
-	cnc = gda_client_open_connection_from_string (client, "SQLite", "DB_DIR=.;DB_NAME=copy",
-						      NULL, NULL,
-						      GDA_CONNECTION_OPTIONS_DONT_SHARE,
-						      &error);
+	cnc = gda_connection_open_from_string ("SQLite", "DB_DIR=.;DB_NAME=copy",
+					       NULL, NULL,
+					       GDA_CONNECTION_OPTIONS_DONT_SHARE,
+					       &error);
         if (!cnc) {
                 g_print ("Could not open connection to local SQLite database: %s\n",
                          error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/samples/TableCopy/common.h
==============================================================================
--- branches/V4-branch/samples/TableCopy/common.h	(original)
+++ branches/V4-branch/samples/TableCopy/common.h	Thu Feb 21 17:19:02 2008
@@ -1,6 +1,6 @@
 #include <libgda/libgda.h>
 
-GdaConnection *open_source_connection (GdaClient *client);
-GdaConnection *open_destination_connection (GdaClient *client);
+GdaConnection *open_source_connection (void);
+GdaConnection *open_destination_connection (void);
 void           run_sql_non_select (GdaConnection *cnc, const gchar *sql);
 

Modified: branches/V4-branch/samples/TableCopy/table-copy-easier.c
==============================================================================
--- branches/V4-branch/samples/TableCopy/table-copy-easier.c	(original)
+++ branches/V4-branch/samples/TableCopy/table-copy-easier.c	Thu Feb 21 17:19:02 2008
@@ -8,24 +8,19 @@
 int
 main (int argc, char *argv[])
 {
-        GdaClient *client;
         GdaConnection *s_cnc, *d_cnc, *virtual;
 
         gda_init ("LibgdaCopyTableEasier", "1.0", argc, argv);
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open "real" connections */
-	s_cnc = open_source_connection (client);
-        d_cnc = open_destination_connection (client);
+	s_cnc = open_source_connection ();
+        d_cnc = open_destination_connection ();
 
 	/* virtual connection settings */
 	GdaVirtualProvider *provider;
 	GError *error = NULL;
 	provider = gda_vprovider_hub_new ();
-        virtual = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
-        g_assert (gda_connection_open (virtual, NULL));
+        virtual = gda_virtual_connection_open (provider, NULL);
 
 	/* adding connections to the cirtual connection */
         if (!gda_vconnection_hub_add (GDA_VCONNECTION_HUB (virtual), s_cnc, "source", &error)) {

Modified: branches/V4-branch/samples/TableCopy/table-copy.c
==============================================================================
--- branches/V4-branch/samples/TableCopy/table-copy.c	(original)
+++ branches/V4-branch/samples/TableCopy/table-copy.c	Thu Feb 21 17:19:02 2008
@@ -11,15 +11,11 @@
 {
         gda_init ("LibgdaCopyTable", "1.0", argc, argv);
 
-        GdaClient *client;
         GdaConnection *s_cnc, *d_cnc;
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open connections */
-	s_cnc = open_source_connection (client);
-	d_cnc = open_destination_connection (client);
+	s_cnc = open_source_connection ();
+	d_cnc = open_destination_connection ();
 
 	/* copy some contents of the 'products' table into the 'products_copied', method 1 */
 	if (! copy_products_1 (s_cnc, d_cnc)) 

Modified: branches/V4-branch/samples/Virtual/virtual-test.c
==============================================================================
--- branches/V4-branch/samples/Virtual/virtual-test.c	(original)
+++ branches/V4-branch/samples/Virtual/virtual-test.c	Thu Feb 21 17:19:02 2008
@@ -17,8 +17,8 @@
 	gda_init ("SQlite virtual test", "1.0", argc, argv);
 
 	provider = gda_vprovider_data_model_new ();
-	cnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, NULL, 0);
-	g_assert (gda_connection_open (cnc, NULL));
+	cnc = gda_virtual_connection_open (provider, NULL);
+	g_assert (cnc);
 
 	/* create RW data model to store results */
 	rw_model = gda_data_model_array_new_with_g_types (2, G_TYPE_STRING, G_TYPE_INT);

Modified: branches/V4-branch/samples/XSLT/transform.c
==============================================================================
--- branches/V4-branch/samples/XSLT/transform.c	(original)
+++ branches/V4-branch/samples/XSLT/transform.c	Thu Feb 21 17:19:02 2008
@@ -22,7 +22,6 @@
 int
 main (int argc, char *argv[])
 {
-        GdaClient *client;
         GdaConnection *cnc;
 	GError *error = NULL;
 	GOptionContext *context;
@@ -50,13 +49,8 @@
 
         gda_init ("LibgdaXsltProc", "1.0", argc, argv);
 
-        /* Create a GdaClient object which is the central object which manages all connections */
-        client = gda_client_new ();
-
 	/* open connection */
-        cnc = gda_client_open_connection (client, "SalesTest", NULL, NULL,
-                                          GDA_CONNECTION_OPTIONS_DONT_SHARE,
-                                          &error);
+        cnc = gda_connection_open_from_dsn ("SalesTest", NULL, NULL, 0, &error);
         if (!cnc) {
                 g_print ("Could not open connection to DSN 'SalesTest': %s\n",
                          error && error->message ? error->message : "No detail");
@@ -86,7 +80,6 @@
 
 	/* close connection */
         g_object_unref (G_OBJECT (cnc));
-        g_object_unref (G_OBJECT (client));
 
         return EXIT_SUCCESS;
 }

Modified: branches/V4-branch/testing/gda-test-blob.c
==============================================================================
--- branches/V4-branch/testing/gda-test-blob.c	(original)
+++ branches/V4-branch/testing/gda-test-blob.c	Thu Feb 21 17:19:02 2008
@@ -34,7 +34,6 @@
 	GError *error = NULL;	
 	GOptionContext *context;
 
-	GdaClient *client;
 	GdaConnection *cnc;
 	gchar *auth_string = NULL;
 	gchar *blob_data;
@@ -72,16 +71,14 @@
 		else
 			auth_string = g_strdup_printf ("USERNAME=%s", user);
 	}
-	client = gda_client_new ();
 	if (dsn) {
 		GdaDataSourceInfo *info = NULL;
 		info = gda_config_get_dsn (dsn);
 		if (!info)
 			g_error (_("DSN '%s' is not declared"), dsn);
 		else {
-			cnc = gda_client_open_connection (client, info->name, 
-							  auth_string ? auth_string : info->auth_string,
-							  0, &error);
+			cnc = gda_connection_open_from_dsn (info->name, auth_string ? auth_string : info->auth_string,
+							    0, &error);
 			if (!cnc) {
 				g_warning (_("Can't open connection to DSN %s: %s\n"), info->name,
 				   error && error->message ? error->message : "???");
@@ -92,7 +89,7 @@
 	}
 	else {
 		
-		cnc = gda_client_open_connection_from_string (client, prov, direct, auth_string, 0, &error);
+		cnc = gda_connection_open_from_string (prov, direct, auth_string, 0, &error);
 		if (!cnc) {
 			g_warning (_("Can't open specified connection: %s\n"),
 				   error && error->message ? error->message : "???");
@@ -102,7 +99,6 @@
 	g_free (auth_string);
 
 	g_print (_("Connection successfully opened!\n"));
-	g_object_unref (G_OBJECT (client));
 
 	parser = gda_connection_create_parser (cnc);
 	gda_connection_begin_transaction (cnc, NULL, GDA_TRANSACTION_ISOLATION_UNKNOWN, NULL);

Modified: branches/V4-branch/testing/gda-test-connection.c
==============================================================================
--- branches/V4-branch/testing/gda-test-connection.c	(original)
+++ branches/V4-branch/testing/gda-test-connection.c	Thu Feb 21 17:19:02 2008
@@ -24,7 +24,6 @@
 	GError *error = NULL;	
 	GOptionContext *context;
 
-	GdaClient *client;
 	GdaConnection *cnc;
 	gchar *auth_string = NULL;
 
@@ -61,26 +60,24 @@
 		else
 			auth_string = g_strdup_printf ("USERNAME=%s", user);
 	}
-	client = gda_client_new ();
 	if (dsn) {
 		GdaDataSourceInfo *info = NULL;
 		info = gda_config_get_dsn (dsn);
 		if (!info)
 			g_error (_("DSN '%s' is not declared"), dsn);
 		else {
-			cnc = gda_client_open_connection (client, info->name, 
-							  auth_string ? auth_string : info->auth_string,
-							  0, &error);
+			cnc = gda_connection_open_from_dsn (info->name, auth_string ? auth_string : info->auth_string,
+							    0, &error);
 			if (!cnc) {
 				g_warning (_("Can't open connection to DSN %s: %s\n"), info->name,
-				   error && error->message ? error->message : "???");
+					   error && error->message ? error->message : "???");
 				exit (1);
 			}
 		}
 	}
 	else {
 		
-		cnc = gda_client_open_connection_from_string (client, prov, direct, auth_string, 0, &error);
+		cnc = gda_connection_open_from_string (prov, direct, auth_string, 0, &error);
 		if (!cnc) {
 			g_warning (_("Can't open specified connection: %s\n"),
 				   error && error->message ? error->message : "???");
@@ -91,7 +88,6 @@
 
 	g_print (_("Connection successfully opened!\n"));
 	gda_connection_close (cnc);
-	g_object_unref (G_OBJECT (client));
 
 	return 0;
 }

Modified: branches/V4-branch/tests/data-models/check_virtual.c
==============================================================================
--- branches/V4-branch/tests/data-models/check_virtual.c	(original)
+++ branches/V4-branch/tests/data-models/check_virtual.c	Thu Feb 21 17:19:02 2008
@@ -19,8 +19,8 @@
 	gda_init ("SQlite virtual test", "1.0", argc, argv);
 
 	provider = gda_vprovider_data_model_new ();
-	cnc = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (provider), NULL, NULL, 0);
-	g_assert (gda_connection_open (cnc, NULL));
+	cnc = gda_virtual_connection (provider, NULL);
+	g_assert (cnc);
 
 	/* create RW data model to store results */
 	rw_model = gda_data_model_array_new_with_g_types (2, G_TYPE_STRING, G_TYPE_INT);

Modified: branches/V4-branch/tests/providers/prov-test-util.c
==============================================================================
--- branches/V4-branch/tests/providers/prov-test-util.c	(original)
+++ branches/V4-branch/tests/providers/prov-test-util.c	Thu Feb 21 17:19:02 2008
@@ -157,7 +157,6 @@
 prov_test_setup_connection (GdaProviderInfo *prov_info, gboolean *params_provided, gboolean *db_created)
 {
 	GdaConnection *cnc = NULL;
-	GdaClient *client;
 	gchar *str, *upname;
 	const gchar *db_params, *cnc_params;
 	GError *error = NULL;
@@ -167,8 +166,6 @@
 
 	g_assert (prov_info);
 
-	client = gda_client_new ();
-
 	upname = prov_name_upcase (prov_info->id);
 	str = g_strdup_printf ("%s_DBCREATE_PARAMS", upname);
 	db_params = getenv (str);
@@ -178,14 +175,14 @@
 
 		db_name = DB_NAME;
 		db_quark_list = gda_quark_list_new_from_string (db_params);
-		op = gda_client_prepare_drop_database (client, db_name, prov_info->id);
+		op = gda_prepare_drop_database (client, db_name, prov_info->id);
 		gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
-		gda_client_perform_create_database (client, op, NULL);
+		gda_perform_create_database (client, op, NULL);
 		g_object_unref (op);
 
-		op = gda_client_prepare_create_database (client, db_name, prov_info->id);
+		op = gda_prepare_create_database (client, db_name, prov_info->id);
 		gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
-		if (!gda_client_perform_create_database (client, op, &error)) {
+		if (!gda_perform_create_database (client, op, &error)) {
 #ifdef CHECK_EXTRA_INFO
 			g_warning ("Could not create the '%s' database (provider %s): %s", db_name,
 				   prov_info->id, error && error->message ? error->message : "No detail");
@@ -229,8 +226,8 @@
 		password = getenv (str);
 		g_free (str);
 
-		cnc = gda_client_open_connection_from_string (client, prov_info->id, data.string->str, username, password, 
-							      GDA_CONNECTION_OPTIONS_NONE, &error);
+		cnc = gda_connection_open_from_string (prov_info->id, data.string->str, username, password, 
+						       GDA_CONNECTION_OPTIONS_NONE, &error);
 		if (!cnc && error) {
 #ifdef CHECK_EXTRA_INFO
 			g_warning ("Could not open connection to %s (provider %s): %s",
@@ -277,12 +274,10 @@
 gboolean
 prov_test_clean_connection (GdaConnection *cnc, gboolean destroy_db)
 {
-	GdaClient *client;
 	gchar *prov_id;
 	gboolean retval = TRUE;
 	gchar *str, *upname;
 
-	client = gda_connection_get_client (cnc);
 	prov_id = g_strdup (gda_connection_get_provider_name (cnc));
 	gda_connection_close (cnc);
 	g_object_unref (cnc);
@@ -309,12 +304,12 @@
 		g_free (str);
 		g_assert (db_params);
 
-		op = gda_client_prepare_drop_database (client, DB_NAME, prov_id);
+		op = gda_prepare_drop_database (client, DB_NAME, prov_id);
 		db_quark_list = gda_quark_list_new_from_string (db_params);
 		gda_quark_list_foreach (db_quark_list, (GHFunc) db_drop_quark_foreach_func, op);
 		gda_quark_list_free (db_quark_list);
 
-		if (!gda_client_perform_drop_database (client, op, &error)) {
+		if (!gda_perform_drop_database (client, op, &error)) {
 #ifdef CHECK_EXTRA_INFO
 			g_warning ("Could not drop the '%s' database (provider %s): %s", DB_NAME,
 				   prov_id, error && error->message ? error->message : "No detail");

Modified: branches/V4-branch/tools/command-exec.c
==============================================================================
--- branches/V4-branch/tools/command-exec.c	(original)
+++ branches/V4-branch/tools/command-exec.c	Thu Feb 21 17:19:02 2008
@@ -326,7 +326,7 @@
 }
 
 GdaInternalCommandResult *
-gda_internal_command_list_tables_views (GdaConnection *cnc, const gchar **args, GError **error, gpointer data)
+gda_internal_command_list_tables (GdaConnection *cnc, const gchar **args, GError **error, gpointer data)
 {
 	GdaInternalCommandResult *res;
 	GdaDataModel *model;
@@ -338,17 +338,65 @@
 
 	if (args[0] && *args[0]) {
 		GValue *v;
+		const gchar *sql = "SELECT table_schema AS Schema, table_name AS Name, table_type as Type, "
+			"table_owner as Owner, table_comments as Description "
+			"FROM _tables WHERE table_name=##tname::string AND "
+			"table_type LIKE '%TABLE%' AND table_short_name = table_name";
+
+		g_value_set_string (v = gda_value_new (G_TYPE_STRING), args[0]);
+		model = gda_meta_store_extract (gda_connection_get_meta_store (cnc), sql, error, "tname", v, NULL);
+		gda_value_free (v);
+	}
+	else {
+		const gchar *sql = "SELECT table_schema AS Schema, table_name AS Name, table_type as Type, "
+			"table_owner as Owner, table_comments as Description "
+			"FROM _tables WHERE table_type LIKE '%TABLE%' AND table_short_name = table_name";
+		model = gda_meta_store_extract (gda_connection_get_meta_store (cnc), sql, error);
+	}
+	if (!model)
+		return NULL;
+
+	g_object_set_data (G_OBJECT (model), "name", _("List of tables"));
+	
+	res = g_new0 (GdaInternalCommandResult, 1);
+	res->type = GDA_INTERNAL_COMMAND_RESULT_DATA_MODEL;
+	res->u.model = model;
+
+	return res;
+}
+
+GdaInternalCommandResult *
+gda_internal_command_list_views (GdaConnection *cnc, const gchar **args, GError **error, gpointer data)
+{
+	GdaInternalCommandResult *res;
+	GdaDataModel *model;
+
+	if (!cnc) {
+		g_set_error (error, 0, 0, _("No current connection"));
+		return NULL;
+	}
+
+	if (args[0] && *args[0]) {
+		GValue *v;
+		const gchar *sql = "SELECT table_schema AS Schema, table_name AS Name, table_type as Type, "
+			"table_owner as Owner, table_comments as Description "
+			"FROM _tables WHERE table_name=##tname::string AND "
+			"table_type = 'VIEW' AND table_short_name = table_name";
+
 		g_value_set_string (v = gda_value_new (G_TYPE_STRING), args[0]);
-		model = gda_connection_get_meta_store_data (cnc, GDA_CONNECTION_META_TABLES, error, 1, "name", v);
+		model = gda_meta_store_extract (gda_connection_get_meta_store (cnc), sql, error, "tname", v, NULL);
 		gda_value_free (v);
 	}
 	else {
-		model = gda_connection_get_meta_store_data (cnc, GDA_CONNECTION_META_TABLES, error, 0);
+		const gchar *sql = "SELECT table_schema AS Schema, table_name AS Name, table_type as Type, "
+			"table_owner as Owner, table_comments as Description "
+			"FROM _tables WHERE table_type='VIEW' AND table_short_name = table_name";
+		model = gda_meta_store_extract (gda_connection_get_meta_store (cnc), sql, error);
 	}
 	if (!model)
 		return NULL;
 
-	g_object_set_data (G_OBJECT (model), "name", _("List of tables and views"));
+	g_object_set_data (G_OBJECT (model), "name", _("List of views"));
 	
 	res = g_new0 (GdaInternalCommandResult, 1);
 	res->type = GDA_INTERNAL_COMMAND_RESULT_DATA_MODEL;

Modified: branches/V4-branch/tools/command-exec.h
==============================================================================
--- branches/V4-branch/tools/command-exec.h	(original)
+++ branches/V4-branch/tools/command-exec.h	Thu Feb 21 17:19:02 2008
@@ -89,8 +89,10 @@
 							GError **error, gpointer data);
 GdaInternalCommandResult *gda_internal_command_dict_sync (GdaConnection *cnc, const gchar **args,
 							  GError **error, gpointer data);
-GdaInternalCommandResult *gda_internal_command_list_tables_views (GdaConnection *cnc, const gchar **args,
-								  GError **error, gpointer data);
+GdaInternalCommandResult *gda_internal_command_list_tables (GdaConnection *cnc, const gchar **args,
+							    GError **error, gpointer data);
+GdaInternalCommandResult *gda_internal_command_list_views (GdaConnection *cnc, const gchar **args,
+							   GError **error, gpointer data);
 GdaInternalCommandResult *gda_internal_command_list_queries (GdaConnection *cnc, const gchar **args,
 							     GError **error, gpointer data);
 GdaInternalCommandResult *gda_internal_command_detail (GdaConnection *cnc, const gchar **args,

Modified: branches/V4-branch/tools/gda-sql.c
==============================================================================
--- branches/V4-branch/tools/gda-sql.c	(original)
+++ branches/V4-branch/tools/gda-sql.c	Thu Feb 21 17:19:02 2008
@@ -102,7 +102,6 @@
 
 /* structure to hold program's data */
 typedef struct {
-	GdaClient *client;
 	GSList *settings; /* list all the CncSetting */
 	ConnectionSetting *current; /* current connection setting to which commands are sent */
 	GdaInternalCommandsList *internal_commands;
@@ -320,8 +319,6 @@
 		g_free (cs->name);
 		g_free (cs);
 	}
-	if (data->client)
-		g_object_unref (data->client);
 	set_input_file (data, NULL, NULL); 
 	set_output_file (data, NULL, NULL); 
 
@@ -833,9 +830,6 @@
 	static gint cncindex = 0;
 	gchar *auth_string = NULL;
 
-	if (!data->client)
-		data->client = gda_client_new ();
-	
 	if (cnc_name && ! connection_name_is_valid (cnc_name)) {
 		g_set_error (error, 0, 0,
 			     _("Connection name '%s' is invalid"), cnc_name);
@@ -857,13 +851,11 @@
 					     _("DSN '%s' is not declared"), dsn);
 		}
                 else 
-                        newcnc = gda_client_open_connection (data->client, info->name,
-							     auth_string ? auth_string : info->auth_string,
-							     0, error);
+                        newcnc = gda_connection_open_from_dsn (info->name, auth_string ? auth_string : info->auth_string,
+							       0, error);
         }
         if (!newcnc && direct) 
-		newcnc = gda_client_open_connection_from_string (data->client, provider, direct,
-								 auth_string, 0, error);
+		newcnc = gda_connection_open_from_string (provider, direct, auth_string, 0, error);
 	g_free (auth_string);
 
 	if (newcnc) {
@@ -1178,9 +1170,19 @@
 	c = g_new0 (GdaInternalCommand, 1);
 	c->group = _("Information");
 	c->name = g_strdup_printf (_("%s [TABLE]"), "dt");
-	c->description = _("List all tables and views (or named table or view)");
+	c->description = _("List all tables (or named table)");
 	c->args = NULL;
-	c->command_func = gda_internal_command_list_tables_views;
+	c->command_func = gda_internal_command_list_tables;
+	c->user_data = NULL;
+	c->arguments_delimiter_func = NULL;
+	commands->commands = g_slist_prepend (commands->commands, c);
+
+	c = g_new0 (GdaInternalCommand, 1);
+	c->group = _("Information");
+	c->name = g_strdup_printf (_("%s [VIEW]"), "dv");
+	c->description = _("List all views (or named view)");
+	c->args = NULL;
+	c->command_func = gda_internal_command_list_views;
 	c->user_data = NULL;
 	c->arguments_delimiter_func = NULL;
 	commands->commands = g_slist_prepend (commands->commands, c);
@@ -1803,10 +1805,9 @@
 		vprovider = gda_vprovider_hub_new ();
 	g_assert (vprovider);
 
-	virtual = gda_server_provider_create_connection (NULL, GDA_SERVER_PROVIDER (vprovider), NULL, NULL, 0);
-	if (!virtual || !gda_connection_open (virtual, NULL)) {
-		g_set_error (error, 0, 0,
-				     _("Could not create virtual connection"));
+	virtual = gda_virtual_connection_open (vprovider, NULL);
+	if (!virtual) {
+		g_set_error (error, 0, 0, _("Could not create virtual connection"));
 		return NULL;
 	}
 



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