[libgda] GdaDbTable: Removed unused API
- From: Pavlo Solntsev <psolntsev src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] GdaDbTable: Removed unused API
- Date: Sun, 12 Jul 2020 03:39:27 +0000 (UTC)
commit d45835fab236ff7446efb1515c2c516af3c2373c
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Thu May 28 11:33:06 2020 -0500
GdaDbTable: Removed unused API
libgda/gda-db-table.c | 112 --------------------------------------------------
libgda/gda-db-table.h | 5 ---
2 files changed, 117 deletions(-)
---
diff --git a/libgda/gda-db-table.c b/libgda/gda-db-table.c
index 27804829b..10a0c7aec 100644
--- a/libgda/gda-db-table.c
+++ b/libgda/gda-db-table.c
@@ -993,118 +993,6 @@ on_error:
return FALSE;
}
-/**
- * gda_db_table_add_index:
- * @self: object to use
- * @index: an instance of #GdaDbIndex to add
- * @cnc: Connection to use
- * @ifnotexists: use or not use "IF NOT EXISTS"
- * @error: error container
- *
- * To drop the index see gda_db_index_drop()
- *
- * Returns: %TRUE if no error and %FALSE otherwise.
- *
- * Stability: Stable
- * Since: 6.0
- */
-gboolean
-gda_db_table_add_index (GdaDbTable *self,
- GdaDbIndex *index,
- GdaConnection *cnc,
- gboolean ifnotexists,
- GError **error)
-{
- G_DEBUG_HERE();
- GdaServerProvider *provider = NULL;
- GdaServerOperation *op = NULL;
-
- g_return_val_if_fail(GDA_IS_DB_TABLE (self), FALSE);
- g_return_val_if_fail(GDA_IS_CONNECTION (cnc), FALSE);
- g_return_val_if_fail(GDA_IS_DB_INDEX(index), FALSE);
-
- if (!gda_connection_is_opened (cnc))
- {
- g_set_error (error, GDA_DB_TABLE_ERROR, GDA_DB_TABLE_CONNECTION_NOT_OPENED,
- _("Connection is not opened"));
- return FALSE;
- }
-
- gda_lockable_lock (GDA_LOCKABLE (cnc));
-
- provider = gda_connection_get_provider (cnc);
-
- op = gda_server_provider_create_operation (provider, cnc, GDA_SERVER_OPERATION_CREATE_INDEX,
- NULL, error);
-
- if (!op)
- {
- g_set_error (error, GDA_DB_TABLE_ERROR, GDA_DB_TABLE_SERVER_OPERATION,
- _("ServerOperation is NULL"));
- goto on_error;
- }
-
- if (gda_db_index_get_unique(index))
- {
- if (!gda_server_operation_set_value_at (op, "UNIQUE", error,
- "/INDEX_DEF_P/INDEX_TYPE"))
- goto on_error;
- }
-
- if (!gda_server_operation_set_value_at (op, gda_db_base_get_full_name (GDA_DB_BASE (index)),
- error, "/INDEX_DEF_P/INDEX_NAME"))
- goto on_error;
-
- if (!gda_server_operation_set_value_at (op, gda_db_base_get_full_name (GDA_DB_BASE(self)),
- error, "/INDEX_DEF_P/INDEX_ON_TABLE"))
- goto on_error;
-
- if (!gda_server_operation_set_value_at (op, GDA_BOOL_TO_STR (ifnotexists),
- error, "/INDEX_DEF_P/INDEX_IFNOTEXISTS"))
- goto on_error;
-
- GSList *it = gda_db_index_get_fields (index);
- gint i = 0;
-
- for (; it != NULL; it = it->next, i++)
- {
- GdaDbColumn *col = gda_db_index_field_get_column (GDA_DB_INDEX_FIELD (it->data));
-
- if (!gda_server_operation_set_value_at (op,
- gda_db_column_get_name (col),
- error,
- "/INDEX_FIELDS_S/%d/INDEX_FIELD",
- i))
- goto on_error;
-
- if (!gda_server_operation_set_value_at (op,
- gda_db_index_field_get_collate (it->data),
- error,
- "/INDEX_FIELDS_S/%d/INDEX_COLLATE",
- i))
- goto on_error;
-
- if (!gda_server_operation_set_value_at (op,
- gda_db_index_field_get_sort_order_str (it->data),
- error,
- "/INDEX_FIELDS_S/%d/INDEX_SORT_ORDER",
- i))
- goto on_error;
- }
-
- if (!gda_server_provider_perform_operation (provider, cnc, op, error))
- goto on_error;
-
- g_object_unref (op);
-
- return TRUE;
-
-on_error:
- if (op) g_object_unref (op);
-
- return FALSE;
-}
-
/**
* gda_db_table_append_constraint:
* @self: a #GdaDbTable instance
diff --git a/libgda/gda-db-table.h b/libgda/gda-db-table.h
index 513f7db9b..f4d44a536 100644
--- a/libgda/gda-db-table.h
+++ b/libgda/gda-db-table.h
@@ -79,11 +79,6 @@ gboolean gda_db_table_update (GdaDbTable *self,
void gda_db_table_append_fkey (GdaDbTable *self,
GdaDbFkey *fkey);
-gboolean gda_db_table_add_index (GdaDbTable *self,
- GdaDbIndex *index,
- GdaConnection *cnc,
- gboolean ifnotexists,
- GError **error);
void gda_db_table_append_constraint (GdaDbTable *self,
const gchar *constraint);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]