[libgda/gtk3] Removed deprecated parts: gda-easy.[ch]
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda/gtk3] Removed deprecated parts: gda-easy.[ch]
- Date: Mon, 28 Feb 2011 17:41:04 +0000 (UTC)
commit 47bfa0b71bc76cb6249b18d2915dde60e9995e82
Author: Vivien Malerba <malerba gnome-db org>
Date: Mon Feb 28 18:29:44 2011 +0100
Removed deprecated parts: gda-easy.[ch]
doc/C/examples/full_example.c | 8 +-
doc/C/howto.xml | 2 +-
doc/C/libgda-5.0-docs.sgml | 3 +-
doc/C/libgda-sections.txt | 26 --
doc/C/tmpl/gda-convenient.sgml | 191 ----------
installers/Windows/make-zip-setup.sh | 2 +-
libgda/Makefile.am | 2 -
libgda/gda-connection-event.c | 24 +--
libgda/gda-connection-event.h | 6 +-
libgda/gda-connection.c | 18 +-
libgda/gda-connection.h | 29 +--
libgda/gda-easy.c | 637 ----------------------------------
libgda/gda-easy.h | 105 ------
libgda/gda-server-operation.c | 10 +-
libgda/gda-server-operation.h | 4 +-
libgda/gda-server-provider-extra.c | 309 +----------------
libgda/gda-server-provider-extra.h | 13 +-
libgda/libgda.h.in | 1 -
libgda/libgda.symbols | 24 --
po/POTFILES.in | 1 -
providers/jdbc/gda-jdbc-util.c | 3 +-
samples/SimpleExample/example.c | 8 +-
tests/test-cnc-utils.c | 4 +-
23 files changed, 40 insertions(+), 1390 deletions(-)
---
diff --git a/doc/C/examples/full_example.c b/doc/C/examples/full_example.c
index 6fad3d8..6e8e925 100644
--- a/doc/C/examples/full_example.c
+++ b/doc/C/examples/full_example.c
@@ -120,7 +120,7 @@ insert_data (GdaConnection *cnc)
g_value_set_float (v3, data[i].price);
}
- res = gda_insert_row_into_table (cnc, "products", &error, "ref", v1, "name", v2, "price", v3, NULL);
+ res = gda_connection_insert_row_into_table (cnc, "products", &error, "ref", v1, "name", v2, "price", v3, NULL);
if (!res) {
g_error ("Could not INSERT data into the 'products' table: %s\n",
@@ -149,7 +149,7 @@ update_data (GdaConnection *cnc)
v3 = gda_value_new (G_TYPE_FLOAT);
g_value_set_float (v3, 1.99);
- res = gda_update_row_in_table (cnc, "products", "ref", v1, &error, "name", v2, "price", v3, NULL);
+ res = gda_connection_update_row_in_table (cnc, "products", "ref", v1, &error, "name", v2, "price", v3, NULL);
if (!res) {
g_error ("Could not UPDATE data in the 'products' table: %s\n",
@@ -172,7 +172,7 @@ delete_data (GdaConnection *cnc)
/* delete data where name is 'table' */
v = gda_value_new_from_string ("table", G_TYPE_STRING);
- res = gda_delete_row_from_table (cnc, "products", "name", v, &error);
+ res = gda_connection_delete_row_from_table (cnc, "products", "name", v, &error);
if (!res) {
g_error ("Could not DELETE data from the 'products' table: %s\n",
error && error->message ? error->message : "No detail");
@@ -180,7 +180,7 @@ delete_data (GdaConnection *cnc)
gda_value_free (v);
/* delete data where price is NULL */
- res = gda_delete_row_from_table (cnc, "products", "price", NULL, &error);
+ res = gda_connection_delete_row_from_table (cnc, "products", "price", NULL, &error);
if (!res) {
g_error ("Could not DELETE data from the 'products' table: %s\n",
error && error->message ? error->message : "No detail");
diff --git a/doc/C/howto.xml b/doc/C/howto.xml
index f182d64..4be53ee 100644
--- a/doc/C/howto.xml
+++ b/doc/C/howto.xml
@@ -354,7 +354,7 @@ g_object_unref (b);
</para>
<para>
However when one only wants to run a simple SQL statement, &LIBGDA; provides the
- <link linkend="gda-execute-select-command">gda_execute_select_command()</link> function which does
+ <link linkend="gda-connection-statement-execute-select-command">gda_connection_statement_execute_select_command()</link> function which does
everything in one step. The following codes illustrates parsing and executing a SELECT statement:
</para>
<para>
diff --git a/doc/C/libgda-5.0-docs.sgml b/doc/C/libgda-5.0-docs.sgml
index 946748f..f9d150f 100644
--- a/doc/C/libgda-5.0-docs.sgml
+++ b/doc/C/libgda-5.0-docs.sgml
@@ -531,7 +531,6 @@
</textobject>
</mediaobject>
</para>
- <xi:include href="xml/gda-convenient.xml"/>
<xi:include href="xml/gda-connection.xml"/>
<xi:include href="xml/gda-sql-parser.xml"/>
<xi:include href="xml/gda-sql-builder.xml"/>
@@ -797,7 +796,7 @@ g_object_unref (tree);
need to unref() it after usage, data handler objects are stateless), and so to obtain such a pointer one can:
<itemizedlist>
<listitem>
- <para>Use the <link linkend="gda-get-default-handler">gda_get_default_handler()</link>: the returned data handler
+ <para>Use the <link linkend="gda-data-handlet-get-default">gda_data_handler_get_default()</link>: the returned data handler
is a generic one and should not be used to convert data to use with any connection, but only to have
a portable way of storing and loading data in a locale independent fashion (for serialization purposes).</para>
</listitem>
diff --git a/doc/C/libgda-sections.txt b/doc/C/libgda-sections.txt
index 3320582..43286e4 100644
--- a/doc/C/libgda-sections.txt
+++ b/doc/C/libgda-sections.txt
@@ -928,31 +928,6 @@ gda_handler_type_get_type
</SECTION>
<SECTION>
-<FILE>gda-convenient</FILE>
-<TITLE>Convenience functions</TITLE>
-gda_prepare_create_database
-gda_perform_create_database
-gda_prepare_drop_database
-gda_perform_drop_database
-<SUBSECTION>
-gda_execute_select_command
-gda_execute_non_select_command
-<SUBSECTION>
-gda_prepare_create_table
-gda_perform_create_table
-gda_prepare_drop_table
-gda_perform_drop_table
-<SUBSECTION>
-gda_insert_row_into_table
-gda_update_row_in_table
-gda_delete_row_from_table
-<SUBSECTION>
-gda_parse_sql_string
-<SUBSECTION>
-gda_get_default_handler
-</SECTION>
-
-<SECTION>
<FILE>gda-report-engine</FILE>
<TITLE>GdaReportEngine</TITLE>
<INCLUDE>libgda-report/gda-report-engine.h</INCLUDE>
@@ -1485,7 +1460,6 @@ gda_connection_internal_get_provider_data
gda_connection_add_event
gda_connection_add_event_string
gda_connection_clear_events_list
-gda_connection_event_new
gda_connection_event_set_event_type
gda_connection_event_set_description
gda_connection_event_set_code
diff --git a/installers/Windows/make-zip-setup.sh b/installers/Windows/make-zip-setup.sh
index 2241b60..81c4816 100755
--- a/installers/Windows/make-zip-setup.sh
+++ b/installers/Windows/make-zip-setup.sh
@@ -438,7 +438,7 @@ add_files_to_nsh core $cross_path lib/gtk-2.0/2.10.0/engines $files
#
# includes
#
-files=(gda-attributes-manager.h gda-batch.h gda-binreloc.h gda-blob-op.h gda-column.h gda-config.h gda-connection-event.h gda-connection.h gda-connection-private.h gda-data-access-wrapper.h gda-data-comparator.h gda-data-handler.h gda-data-model-array.h gda-data-model-bdb.h gda-data-model-dir.h gda-data-model-extra.h gda-data-model.h gda-data-model-import.h gda-data-model-iter-extra.h gda-data-model-iter.h gda-data-model-private.h gda-data-proxy.h gda-data-select.h gda-debug-macros.h gda-decl.h gda-easy.h gda-enums.h gda-enum-types.h gda-holder.h gda-lockable.h gda-log.h gda-marshal.h gda-meta-store.h gda-meta-struct.h gda-mutex.h gda-quark-list.h gda-row.h gda-server-operation.h gda-server-provider-extra.h gda-server-provider.h gda-server-provider-private.h gda-set.h gda-statement-extra.h gda-statement.h gda-transaction-status.h gda-transaction-status-private.h gda-util.h gda-value.h gda-xa-transaction.h libgda.h libgda-global-variables.h gda-repetitive-statement.h gda-sql-
builder.h gda-tree.h gda-tree-manager.h gda-tree-mgr-columns.h gda-tree-mgr-label.h gda-tree-mgr-schemas.h gda-tree-mgr-select.h gda-tree-mgr-tables.h gda-tree-node.h)
+files=(gda-attributes-manager.h gda-batch.h gda-binreloc.h gda-blob-op.h gda-column.h gda-config.h gda-connection-event.h gda-connection.h gda-connection-private.h gda-data-access-wrapper.h gda-data-comparator.h gda-data-handler.h gda-data-model-array.h gda-data-model-bdb.h gda-data-model-dir.h gda-data-model-extra.h gda-data-model.h gda-data-model-import.h gda-data-model-iter-extra.h gda-data-model-iter.h gda-data-model-private.h gda-data-proxy.h gda-data-select.h gda-debug-macros.h gda-decl.h gda-enums.h gda-enum-types.h gda-holder.h gda-lockable.h gda-log.h gda-marshal.h gda-meta-store.h gda-meta-struct.h gda-mutex.h gda-quark-list.h gda-row.h gda-server-operation.h gda-server-provider-extra.h gda-server-provider.h gda-server-provider-private.h gda-set.h gda-statement-extra.h gda-statement.h gda-transaction-status.h gda-transaction-status-private.h gda-util.h gda-value.h gda-xa-transaction.h libgda.h libgda-global-variables.h gda-repetitive-statement.h gda-sql-builder.h g
da-tree.h gda-tree-manager.h gda-tree-mgr-columns.h gda-tree-mgr-label.h gda-tree-mgr-schemas.h gda-tree-mgr-select.h gda-tree-mgr-tables.h gda-tree-node.h)
add_files_to_zip $archive_dev $prefix include/libgda-5.0/libgda $files
files=(gda-sqlite-provider.h)
diff --git a/libgda/Makefile.am b/libgda/Makefile.am
index f0bd4df..8fe6529 100644
--- a/libgda/Makefile.am
+++ b/libgda/Makefile.am
@@ -63,7 +63,6 @@ gda_headers = \
gda-data-select.h \
gda-debug-macros.h \
gda-decl.h \
- gda-easy.h \
gda-enums.h \
gda-holder.h \
gda-lockable.h \
@@ -122,7 +121,6 @@ gda_sources= \
gda-data-meta-wrapper.h \
gda-data-proxy.c \
gda-data-select.c \
- gda-easy.c \
gda-holder.c \
gda-init.c \
gda-lockable.c \
diff --git a/libgda/gda-connection-event.c b/libgda/gda-connection-event.c
index 24a15e3..3dfc12b 100644
--- a/libgda/gda-connection-event.c
+++ b/libgda/gda-connection-event.c
@@ -1,5 +1,5 @@
-/* GDA server library
- * Copyright (C) 1998 - 2010 The GNOME Foundation.
+/*
+ * Copyright (C) 1998 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Michael Lausch <michael lausch at>
@@ -110,26 +110,6 @@ gda_connection_event_init (GdaConnectionEvent *event, G_GNUC_UNUSED GdaConnectio
event->priv->gda_code = GDA_CONNECTION_EVENT_CODE_UNKNOWN;
}
-/**
- * gda_connection_event_new:
- * @type: the type of event
- *
- * Creates a new uninitialized event object. This class is used for communicating
- * events from the different providers to the clients.
- *
- * Returns: the event object.
- *
- * Deprecated: 4.2: use gda_connection_point_available_event() instead
- */
-GdaConnectionEvent *
-gda_connection_event_new (GdaConnectionEventType type)
-{
- GdaConnectionEvent *event;
-
- event = GDA_CONNECTION_EVENT (g_object_new (GDA_TYPE_CONNECTION_EVENT, "type", (int)type, NULL));
- return event;
-}
-
static void
gda_connection_event_finalize (GObject *object)
{
diff --git a/libgda/gda-connection-event.h b/libgda/gda-connection-event.h
index 7b8a1f6..35f209a 100644
--- a/libgda/gda-connection-event.h
+++ b/libgda/gda-connection-event.h
@@ -1,5 +1,5 @@
-/* GDA server library
- * Copyright (C) 1998 - 2009 The GNOME Foundation.
+/*
+ * Copyright (C) 1998 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Michael Lausch <michael lausch at>
@@ -44,6 +44,7 @@ struct _GdaConnectionEvent {
struct _GdaConnectionEventClass {
GObjectClass parent_class;
+ /*< private >*/
/* Padding for future expansion */
void (*_gda_reserved1) (void);
void (*_gda_reserved2) (void);
@@ -86,7 +87,6 @@ typedef enum
#define GDA_SQLSTATE_GENERAL_ERROR "HY000"
GType gda_connection_event_get_type (void) G_GNUC_CONST;
-GdaConnectionEvent *gda_connection_event_new (GdaConnectionEventType type);
void gda_connection_event_set_event_type (GdaConnectionEvent *event, GdaConnectionEventType type);
GdaConnectionEventType gda_connection_event_get_event_type (GdaConnectionEvent *event);
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index a2eae98..956e714 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -1,4 +1,4 @@
-/* GDA library
+/*
* Copyright (C) 1998 - 2011 The GNOME Foundation.
*
* AUTHORS:
@@ -1534,7 +1534,8 @@ add_connection_event_from_error (GdaConnection *cnc, GError **error)
{
GdaConnectionEvent *event;
gchar *str;
- event = gda_connection_event_new (GDA_CONNECTION_EVENT_WARNING);
+ event = GDA_CONNECTION_EVENT (g_object_new (GDA_TYPE_CONNECTION_EVENT,
+ "type", (int)GDA_CONNECTION_EVENT_WARNING, NULL));
str = g_strdup_printf (_("Error while maintaining the meta data up to date: %s"),
error && *error && (*error)->message ? (*error)->message : _("No detail"));
gda_connection_event_set_description (event, str);
@@ -2264,9 +2265,7 @@ gda_connection_parse_sql_string (GdaConnection *cnc, const gchar *sql, GdaSet **
* @type: a #GdaConnectionEventType
*
* Use this method to get a pointer to the next available connection event which can then be customized
- * and taken into account using gda_connection_add_event(). This method is a drop-in replacament
- * for gda_connection_event_new() which improves performances by reusing as much as possible
- * #GdaConnectionEvent objects. Newly written database providers should use this method.
+ * and taken into account using gda_connection_add_event().
*
* Returns: (transfer full) (allow-none): a pointer to the next available connection event, or %NULL if event should
* be ignored
@@ -2283,7 +2282,8 @@ gda_connection_point_available_event (GdaConnection *cnc, GdaConnectionEventType
GdaConnectionEvent *eev;
eev = cnc->priv->events_array [cnc->priv->events_array_next];
if (!eev)
- eev = gda_connection_event_new (type);
+ eev = GDA_CONNECTION_EVENT (g_object_new (GDA_TYPE_CONNECTION_EVENT,
+ "type", (int)type, NULL));
else {
gda_connection_event_set_event_type (eev, type);
cnc->priv->events_array [cnc->priv->events_array_next] = NULL;
@@ -3305,8 +3305,7 @@ gda_connection_statement_execute (GdaConnection *cnc, GdaStatement *stmt, GdaSet
* @last_insert_row: (out) (transfer full) (allow-none): a place to store a new #GdaSet object which contains the values of the last inserted row, or %NULL
* @error: a place to store an error, or %NULL
*
- * Executes a non-selection statement on the given connection. The gda_execute_non_select_command() method can be easier
- * to use if one prefers to use some SQL directly.
+ * Executes a non-selection statement on the given connection.
*
* This function returns the number of rows affected by the execution of @stmt, or -1
* if an error occurred, or -2 if the connection's provider does not return the number of rows affected.
@@ -3375,8 +3374,7 @@ gda_connection_statement_execute_non_select (GdaConnection *cnc, GdaStatement *s
* @params: (allow-none): a #GdaSet object (which can be obtained using gda_statement_get_parameters()), or %NULL
* @error: a place to store an error, or %NULL
*
- * Executes a selection command on the given connection. The gda_execute_select_command() method can be easier
- * to use if one prefers to use some SQL directly.
+ * Executes a selection command on the given connection.
*
* This function returns a #GdaDataModel resulting from the SELECT statement, or %NULL
* if an error occurred.
diff --git a/libgda/gda-connection.h b/libgda/gda-connection.h
index 9a4b75e..3f4562c 100644
--- a/libgda/gda-connection.h
+++ b/libgda/gda-connection.h
@@ -1,5 +1,5 @@
-/* GDA library
- * Copyright (C) 1998 - 2010 The GNOME Foundation.
+/*
+ * Copyright (C) 1998 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Michael Lausch <michael lausch at>
@@ -199,31 +199,6 @@ typedef enum {
GDA_CONNECTION_FEATURE_LAST
} GdaConnectionFeature;
-
-/**
- * GdaConnectionSchema
- *
- * Deprecated: 4.2: This was a leftover from the pre 4.0 area
- */
-typedef enum {
- GDA_CONNECTION_SCHEMA_AGGREGATES,
- GDA_CONNECTION_SCHEMA_DATABASES,
- GDA_CONNECTION_SCHEMA_FIELDS,
- GDA_CONNECTION_SCHEMA_INDEXES,
- GDA_CONNECTION_SCHEMA_LANGUAGES,
- GDA_CONNECTION_SCHEMA_NAMESPACES,
- GDA_CONNECTION_SCHEMA_PARENT_TABLES,
- GDA_CONNECTION_SCHEMA_PROCEDURES,
- GDA_CONNECTION_SCHEMA_SEQUENCES,
- GDA_CONNECTION_SCHEMA_TABLES,
- GDA_CONNECTION_SCHEMA_TRIGGERS,
- GDA_CONNECTION_SCHEMA_TYPES,
- GDA_CONNECTION_SCHEMA_USERS,
- GDA_CONNECTION_SCHEMA_VIEWS,
- GDA_CONNECTION_SCHEMA_CONSTRAINTS,
- GDA_CONNECTION_SCHEMA_TABLE_CONTENTS
-} GdaConnectionSchema;
-
/**
* GdaConnectionMetaType:
* @GDA_CONNECTION_META_NAMESPACES: lists the <link linkend="GdaConnectionMetaTypeGDA_CONNECTION_META_NAMESPACES">namespaces</link> (or schemas for PostgreSQL)
diff --git a/libgda/gda-server-operation.c b/libgda/gda-server-operation.c
index c690fcb..ec7bade 100644
--- a/libgda/gda-server-operation.c
+++ b/libgda/gda-server-operation.c
@@ -1,5 +1,5 @@
-/* GDA library
- * Copyright (C) 2006 - 2010 The GNOME Foundation.
+/*
+ * Copyright (C) 2006 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
@@ -2496,7 +2496,7 @@ gda_server_operation_prepare_drop_database (const gchar *provider, const gchar *
/**
* gda_server_operation_perform_drop_database:
* @provider: the database provider to use, or %NULL if @op has been created using gda_server_operation_prepare_drop_database()
- * @op: a #GdaServerOperation object obtained using gda_prepare_drop_database()
+ * @op: a #GdaServerOperation object obtained using gda_server_operation_prepare_drop_database()
* @error: a place to store en error, or %NULL
*
* Destroys an existing database using the specifications in @op. @op can be obtained using
@@ -2531,7 +2531,7 @@ gda_server_operation_perform_drop_database (GdaServerOperation *op, const gchar
* @table_name: name of the table to create
* @error: a place to store errors, or %NULL
* @...: group of three arguments for column's name, column's #GType
- * and a #GdaEasyCreateTableFlag flag, finished with %NULL
+ * and a #GdaServerOperationCreateTableFlag flag, finished with %NULL
*
* Add more arguments if the flag needs them:
*
@@ -2548,7 +2548,7 @@ gda_server_operation_perform_drop_database (GdaServerOperation *op, const gchar
* </itemizedlist>
*
* Create a #GdaServerOperation object using an opened connection, taking three
- * arguments, a column's name the column's GType and #GdaEasyCreateTableFlag
+ * arguments, a column's name the column's GType and #GdaServerOperationCreateTableFlag
* flag, you need to finish the list using %NULL.
*
* You'll be able to modify the #GdaServerOperation object to add custom options * to the operation. When finished call #gda_server_operation_perform_create_table
diff --git a/libgda/gda-server-operation.h b/libgda/gda-server-operation.h
index 934b5b5..9b21a02 100644
--- a/libgda/gda-server-operation.h
+++ b/libgda/gda-server-operation.h
@@ -1,5 +1,5 @@
-/* GDA library
- * Copyright (C) 2006 - 2009 The GNOME Foundation.
+/*
+ * Copyright (C) 2006 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
diff --git a/libgda/gda-server-provider-extra.c b/libgda/gda-server-provider-extra.c
index 86d699d..fdf7cae 100644
--- a/libgda/gda-server-provider-extra.c
+++ b/libgda/gda-server-provider-extra.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005 - 2010 The GNOME Foundation.
+ * Copyright (C) 2005 - 2011 The GNOME Foundation.
*
* AUTHORS:
* Vivien Malerba <malerba gnome-db org>
@@ -260,313 +260,6 @@ gda_select_alter_select_for_empty (GdaStatement *stmt, G_GNUC_UNUSED GError **er
}
/**
- * gda_server_provider_get_schema_nb_columns:
- * @schema: a #GdaConnectionSchema
- *
- * Returns: the number of columns the #GdaDataModel for the requested schema
- * must have
- *
- * Deprecated: 4.2: This was a leftover from the pre 4.0 area
- */
-gint
-gda_server_provider_get_schema_nb_columns (GdaConnectionSchema schema)
-{
- switch (schema) {
- case GDA_CONNECTION_SCHEMA_AGGREGATES:
- return 7;
- case GDA_CONNECTION_SCHEMA_DATABASES:
- return 1;
- case GDA_CONNECTION_SCHEMA_FIELDS:
- return 10;
- case GDA_CONNECTION_SCHEMA_INDEXES:
- return 1;
- case GDA_CONNECTION_SCHEMA_LANGUAGES:
- return 1;
- case GDA_CONNECTION_SCHEMA_NAMESPACES:
- return 1;
- case GDA_CONNECTION_SCHEMA_PARENT_TABLES:
- return 2;
- case GDA_CONNECTION_SCHEMA_PROCEDURES:
- return 8;
- case GDA_CONNECTION_SCHEMA_SEQUENCES:
- return 4;
- case GDA_CONNECTION_SCHEMA_TABLES:
- return 4;
- case GDA_CONNECTION_SCHEMA_TRIGGERS:
- return 1;
- case GDA_CONNECTION_SCHEMA_TYPES:
- return 5;
- case GDA_CONNECTION_SCHEMA_USERS:
- return 1;
- case GDA_CONNECTION_SCHEMA_VIEWS:
- return 4;
- case GDA_CONNECTION_SCHEMA_CONSTRAINTS:
- return 5;
- default:
- g_assert_not_reached ();
- }
-}
-
-typedef struct {
- gchar *col_name;
- GType data_type;
-} GdaSchemaColData;
-
-GdaSchemaColData aggs_spec [] = {
- /* To translators: "Aggregate": the noun */
- { N_("Aggregate"), G_TYPE_STRING},
- { N_("Id"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Comments"), G_TYPE_STRING},
- { N_("OutType"), G_TYPE_STRING},
- { N_("InType"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING}
-};
-
-GdaSchemaColData dbs_spec [] = {
- { N_("Database"), G_TYPE_STRING}
-};
-
-GdaSchemaColData fields_spec [] = {
- { N_("Field name"), G_TYPE_STRING},
- { N_("Data type"), G_TYPE_STRING},
- { N_("Size"), G_TYPE_INT},
- { N_("Scale"), G_TYPE_INT},
- { N_("Not null?"), G_TYPE_BOOLEAN},
- { N_("Primary key?"), G_TYPE_BOOLEAN},
- { N_("Unique index?"), G_TYPE_BOOLEAN},
- { N_("References"), G_TYPE_STRING},
- { N_("Default value"), G_TYPE_STRING},
- { N_("Extra attributes"), G_TYPE_STRING}
-};
-
-GdaSchemaColData indexes_spec [] = {
- { N_("Index"), G_TYPE_STRING}
-};
-
-GdaSchemaColData lang_spec [] = {
- { N_("Language"), G_TYPE_STRING}
-};
-
-GdaSchemaColData ns_spec [] = {
- { N_("Namespace"), G_TYPE_STRING}
-};
-
-GdaSchemaColData parent_spec [] = {
- { N_("Table"), G_TYPE_STRING},
- { N_("Sequence"), G_TYPE_INT}
-};
-
-GdaSchemaColData procs_spec [] = {
- { N_("Procedure"), G_TYPE_STRING},
- { N_("Id"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Comments"), G_TYPE_STRING},
- { N_("Return type"), G_TYPE_STRING},
- /* To translators: "Nb args": the procedure's number of arguments */
- { N_("Nb args"), G_TYPE_INT},
- { N_("Args types"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING}
-};
-
-GdaSchemaColData seq_spec [] = {
- { N_("Sequence"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Comments"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING}
-};
-
-GdaSchemaColData table_spec [] = {
- { N_("Table"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Description"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING}
-};
-
-GdaSchemaColData trigger_spec [] = {
- { N_("Trigger"), G_TYPE_STRING}
-};
-
-GdaSchemaColData types_spec [] = {
- { N_("Type"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Comments"), G_TYPE_STRING},
- { N_("GDA type"), G_TYPE_ULONG},
- { N_("Synonyms"), G_TYPE_STRING}
-};
-
-GdaSchemaColData user_spec [] = {
- { N_("User"), G_TYPE_STRING}
-};
-
-GdaSchemaColData view_spec [] = {
- { N_("View"), G_TYPE_STRING},
- { N_("Owner"), G_TYPE_STRING},
- { N_("Description"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING}
-};
-
-GdaSchemaColData constraint_spec [] = {
- { N_("Name"), G_TYPE_STRING},
- { N_("Type"), G_TYPE_STRING},
- { N_("Fields"), G_TYPE_STRING},
- { N_("Definition"), G_TYPE_STRING},
- { N_("Options"), G_TYPE_STRING}
-};
-
-static GdaSchemaColData *
-schema_get_spec (GdaConnectionSchema schema)
-{
- GdaSchemaColData *spec = NULL;
-
- switch (schema) {
- case GDA_CONNECTION_SCHEMA_AGGREGATES:
- spec = aggs_spec;
- break;
- case GDA_CONNECTION_SCHEMA_DATABASES:
- spec = dbs_spec;
- break;
- case GDA_CONNECTION_SCHEMA_FIELDS:
- spec = fields_spec;
- break;
- case GDA_CONNECTION_SCHEMA_INDEXES:
- spec = indexes_spec;
- break;
- case GDA_CONNECTION_SCHEMA_LANGUAGES:
- spec = lang_spec;
- break;
- case GDA_CONNECTION_SCHEMA_NAMESPACES:
- spec = ns_spec;
- break;
- case GDA_CONNECTION_SCHEMA_PARENT_TABLES:
- spec = parent_spec;
- break;
- case GDA_CONNECTION_SCHEMA_PROCEDURES:
- spec = procs_spec;
- break;
- case GDA_CONNECTION_SCHEMA_SEQUENCES:
- spec = seq_spec;
- break;
- case GDA_CONNECTION_SCHEMA_TABLES:
- spec = table_spec;
- break;
- case GDA_CONNECTION_SCHEMA_TRIGGERS:
- spec = trigger_spec;
- break;
- case GDA_CONNECTION_SCHEMA_TYPES:
- spec = types_spec;
- break;
- case GDA_CONNECTION_SCHEMA_USERS:
- spec = user_spec;
- break;
- case GDA_CONNECTION_SCHEMA_VIEWS:
- spec = view_spec;
- break;
- case GDA_CONNECTION_SCHEMA_CONSTRAINTS:
- spec = constraint_spec;
- break;
- default:
- g_assert_not_reached ();
- }
-
- return spec;
-}
-
-/**
- * gda_server_provider_init_schema_model:
- * @model: a #GdaDataModel
- * @schema: a #GdaConnectionSchema
- *
- * Sets the column attributes of @model for the requested schema
- *
- * Returns: %TRUE if there was no error
- *
- * Deprecated: 4.2: This was a leftover from the pre 4.0 area
- */
-gboolean
-gda_server_provider_init_schema_model (GdaDataModel *model, GdaConnectionSchema schema)
-{
- GdaSchemaColData *spec = NULL;
- gint nbcols, i;
- GdaColumn *column;
-
- g_return_val_if_fail (model && GDA_IS_DATA_MODEL (model), FALSE);
- spec = schema_get_spec (schema);
-
- nbcols = gda_server_provider_get_schema_nb_columns (schema);
- if (gda_data_model_get_n_columns (model) != nbcols)
- return FALSE;
-
- for (i = 0; i < nbcols; i++) {
- column = gda_data_model_describe_column (GDA_DATA_MODEL (model), i);
-
- gda_column_set_description (column, spec[i].col_name);
- gda_column_set_name (column, spec[i].col_name);
- gda_column_set_g_type (column, spec[i].data_type);
- }
-
- return TRUE;
-}
-
-/**
- * gda_server_provider_test_schema_model:
- * @model: a #GdaDataModel to test
- * @schema:
- * @error:
- *
- * Test that the structure of @model is correct in regard with @schema
- *
- * Returns: %TRUE if @model has the correct structure
- *
- * Deprecated: 4.2: This was a leftover from the pre 4.0 area
- */
-gboolean
-gda_server_provider_test_schema_model (GdaDataModel *model, GdaConnectionSchema schema, GError **error)
-{
- gint i, nbcols;
- GdaSchemaColData *spec = NULL;
-
- g_return_val_if_fail (model && GDA_IS_DATA_MODEL (model), FALSE);
-
- nbcols = gda_data_model_get_n_columns (model);
- if (nbcols < gda_server_provider_get_schema_nb_columns (schema)) {
- g_set_error (error, 0, 0, "%s",
- _("Data model for schema has a wrong number of columns"));
- return FALSE;
- }
-
- spec = schema_get_spec (schema);
- for (i = 0; i < nbcols; i++) {
- GdaColumn *column;
-
- column = gda_data_model_describe_column (GDA_DATA_MODEL (model), i);
-
- if (strcmp (gda_column_get_description (column), spec[i].col_name)) {
- g_set_error (error, 0, 0,
- _("Data model for schema has a wrong column title: '%s' instead of '%s'"),
- gda_column_get_description (column), spec[i].col_name);
- return FALSE;
- }
-
- if (strcmp (gda_column_get_name (column), spec[i].col_name)) {
- g_set_error (error, 0, 0,
- _("Data model for schema has a wrong column name: '%s' instead of '%s'"),
- gda_column_get_name (column), spec[i].col_name);
- return FALSE;
- }
-
- if (gda_column_get_g_type (column) != spec[i].data_type) {
- g_set_error (error, 0, 0,
- _("Data model for schema has a wrong gda type: %s instead of %s"),
- gda_g_type_to_string (gda_column_get_g_type (column)),
- gda_g_type_to_string (spec[i].data_type));
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/**
* gda_server_provider_handler_find:
*
* Returns: (transfer none):
diff --git a/libgda/gda-server-provider-extra.h b/libgda/gda-server-provider-extra.h
index c146ad7..6e4c994 100644
--- a/libgda/gda-server-provider-extra.h
+++ b/libgda/gda-server-provider-extra.h
@@ -1,6 +1,5 @@
-/* gda-server-provider-extra.h
- *
- * Copyright (C) 2005 - 2008 Vivien Malerba
+/*
+ * Copyright (C) 2005 - 2011 Vivien Malerba
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
@@ -33,14 +32,6 @@ G_BEGIN_DECLS
GdaSqlParser *gda_server_provider_internal_get_parser (GdaServerProvider *prov);
/*
- * Help to implement providers, so the schemas return the same
- * number of columns and column titles across the providers.
- */
-gint gda_server_provider_get_schema_nb_columns (GdaConnectionSchema schema);
-gboolean gda_server_provider_init_schema_model (GdaDataModel *model, GdaConnectionSchema schema);
-gboolean gda_server_provider_test_schema_model (GdaDataModel *model, GdaConnectionSchema schema, GError **error);
-
-/*
* Default perform operation
*/
gboolean gda_server_provider_perform_operation_default (GdaServerProvider *provider, GdaConnection *cnc,
diff --git a/libgda/libgda.h.in b/libgda/libgda.h.in
index 2e384d4..7fb4216 100644
--- a/libgda/libgda.h.in
+++ b/libgda/libgda.h.in
@@ -27,7 +27,6 @@
#define __LIBGDA_H__
#include <libgda/gda-attributes-manager.h>
-#include <libgda/gda-easy.h>
#include <libgda/gda-column.h>
#include <libgda/gda-config.h>
#include <libgda/gda-connection-event.h>
diff --git a/libgda/libgda.symbols b/libgda/libgda.symbols
index 6f6e06b..1fb98b5 100644
--- a/libgda/libgda.symbols
+++ b/libgda/libgda.symbols
@@ -113,7 +113,6 @@
gda_connection_event_get_source
gda_connection_event_get_sqlstate
gda_connection_event_get_type
- gda_connection_event_new
gda_connection_event_set_code
gda_connection_event_set_description
gda_connection_event_set_event_type
@@ -327,25 +326,18 @@
gda_data_select_take_row
gda_default_escape_string
gda_default_unescape_string
- gda_delete_row_from_table
gda_diff_type_get_type
gda_dir_blob_get_filename
gda_dir_blob_op_get_type
gda_dir_blob_op_new
gda_dir_blob_set_filename
gda_dsn_split
- gda_easy_create_table_flag_get_type
- gda_easy_error_get_type
- gda_easy_error_quark
- gda_execute_non_select_command
- gda_execute_select_command
gda_gbr_get_file_path
gda_gbr_init
gda_geometricpoint_copy
gda_geometricpoint_free
gda_geometricpoint_get_type
gda_get_application_exec_path
- gda_get_default_handler
gda_g_type_from_string
gda_g_type_to_string
gda_handler_bin_get_type
@@ -399,8 +391,6 @@
gda_identifier_equal
gda_identifier_hash
gda_init
- gda_insert_row_into_table
- gda_insert_row_into_table_v
gda_lang_locale
gda_locale_changed
gda_lockable_get_type
@@ -472,15 +462,6 @@
gda_parse_iso8601_date
gda_parse_iso8601_time
gda_parse_iso8601_timestamp
- gda_parse_sql_string
- gda_perform_create_database
- gda_perform_create_table
- gda_perform_drop_database
- gda_perform_drop_table
- gda_prepare_create_database
- gda_prepare_create_table
- gda_prepare_drop_database
- gda_prepare_drop_table
gda_pstmt_copy_contents
gda_pstmt_get_gda_statement
gda_pstmt_get_type
@@ -556,13 +537,11 @@
gda_server_provider_get_data_handler_g_type
gda_server_provider_get_default_dbms_type
gda_server_provider_get_name
- gda_server_provider_get_schema_nb_columns
gda_server_provider_get_server_version
gda_server_provider_get_type
gda_server_provider_get_version
gda_server_provider_handler_declare
gda_server_provider_handler_find
- gda_server_provider_init_schema_model
gda_server_provider_internal_get_parser
gda_server_provider_load_file_contents
gda_server_provider_perform_operation
@@ -571,7 +550,6 @@
gda_server_provider_string_to_value
gda_server_provider_supports_feature
gda_server_provider_supports_operation
- gda_server_provider_test_schema_model
gda_server_provider_unescape_string
gda_server_provider_value_to_sql_string
gda_set_add_holder
@@ -876,8 +854,6 @@
gda_tree_set_attribute
gda_tree_update_all
gda_tree_update_part
- gda_update_row_in_table
- gda_update_row_in_table_v
gda_ushort_get_type
gda_utility_check_data_model
gda_utility_data_model_dump_data_to_xml
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 50e63ac..3ed1fe0 100755
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -22,7 +22,6 @@ libgda/gda-data-model-import.c
libgda/gda-data-model-iter.c
libgda/gda-data-proxy.c
libgda/gda-data-select.c
-libgda/gda-easy.c
libgda/gda-holder.c
libgda/gda-init.c
libgda/gda-log.c
diff --git a/providers/jdbc/gda-jdbc-util.c b/providers/jdbc/gda-jdbc-util.c
index 4f44c30..cdf1408 100644
--- a/providers/jdbc/gda-jdbc-util.c
+++ b/providers/jdbc/gda-jdbc-util.c
@@ -40,7 +40,8 @@ _gda_jdbc_make_error (GdaConnection *cnc, gint error_code, gchar *sql_state, GEr
GdaConnectionEventCode gda_code = GDA_CONNECTION_EVENT_CODE_UNKNOWN;
GdaTransactionStatus *trans;
- error_ev = gda_connection_event_new (GDA_CONNECTION_EVENT_ERROR);
+ error_ev = GDA_CONNECTION_EVENT (g_object_new (GDA_TYPE_CONNECTION_EVENT, "type",
+ (gint) GDA_CONNECTION_EVENT_ERROR, NULL));
if (error) {
gda_connection_event_set_description (error_ev,
error->message ? error->message : _("No detail"));
diff --git a/samples/SimpleExample/example.c b/samples/SimpleExample/example.c
index ded1406..f6bf6fa 100644
--- a/samples/SimpleExample/example.c
+++ b/samples/SimpleExample/example.c
@@ -117,7 +117,7 @@ insert_data (GdaConnection *cnc)
g_value_set_float (v3, data[i].price);
}
- res = gda_insert_row_into_table (cnc, "products", &error, "ref", v1, "name", v2, "price", v3, NULL);
+ res = gda_connection_insert_row_into_table (cnc, "products", &error, "ref", v1, "name", v2, "price", v3, NULL);
if (!res) {
g_error ("Could not INSERT data into the 'products' table: %s\n",
@@ -146,7 +146,7 @@ update_data (GdaConnection *cnc)
v3 = gda_value_new (G_TYPE_FLOAT);
g_value_set_float (v3, 1.99);
- res = gda_update_row_in_table (cnc, "products", "ref", v1, &error, "name", v2, "price", v3, NULL);
+ res = gda_connection_update_row_in_table (cnc, "products", "ref", v1, &error, "name", v2, "price", v3, NULL);
if (!res) {
g_error ("Could not UPDATE data in the 'products' table: %s\n",
@@ -169,7 +169,7 @@ delete_data (GdaConnection *cnc)
/* delete data where name is 'table' */
v = gda_value_new_from_string ("table", G_TYPE_STRING);
- res = gda_delete_row_from_table (cnc, "products", "name", v, &error);
+ res = gda_connection_delete_row_from_table (cnc, "products", "name", v, &error);
if (!res) {
g_error ("Could not DELETE data from the 'products' table: %s\n",
error && error->message ? error->message : "No detail");
@@ -177,7 +177,7 @@ delete_data (GdaConnection *cnc)
gda_value_free (v);
/* delete data where price is NULL */
- res = gda_delete_row_from_table (cnc, "products", "price", NULL, &error);
+ res = gda_connection_delete_row_from_table (cnc, "products", "price", NULL, &error);
if (!res) {
g_error ("Could not DELETE data from the 'products' table: %s\n",
error && error->message ? error->message : "No detail");
diff --git a/tests/test-cnc-utils.c b/tests/test-cnc-utils.c
index db5dd8e..f7579d6 100644
--- a/tests/test-cnc-utils.c
+++ b/tests/test-cnc-utils.c
@@ -114,14 +114,14 @@ test_cnc_setup_connection (const gchar *provider, const gchar *dbname, GError **
GdaServerOperation *op;
db_quark_list = gda_quark_list_new_from_string (db_params);
- op = gda_server_operation_prepare_drop_database (prov_info->id, dbname, NULL);
+ op = gda_server_operation_prepare_create_database (prov_info->id, dbname, NULL);
gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
gda_server_operation_perform_drop_database (op, NULL, NULL);
g_object_unref (op);
op = gda_server_operation_prepare_create_database (prov_info->id, dbname, NULL);
gda_quark_list_foreach (db_quark_list, (GHFunc) db_create_quark_foreach_func, op);
- if (!gda_perform_create_database (NULL, op, error))
+ if (!gda_server_operation_perform_create_database (op, NULL, error))
goto out;
db_created = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]