[libgda: 1/2] GdaDbCatalog: MetaDbObject API remoed from public
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda: 1/2] GdaDbCatalog: MetaDbObject API remoed from public
- Date: Sun, 13 Jan 2019 20:39:10 +0000 (UTC)
commit e6b54e6681e3f54e489f6e83401eec8bcd39b373
Author: Pavlo Solntsev <p sun fun gmail com>
Date: Fri Jan 11 14:11:59 2019 -0600
GdaDbCatalog: MetaDbObject API remoed from public
_gda_db_table_new_from_meta () and _gda_db_view_new_from_meta ()
were removed from public API.
libgda/gda-db-catalog.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++--
libgda/gda-db-table.c | 50 -------------------------------
libgda/gda-db-table.h | 24 +++++++--------
libgda/gda-db-view.c | 21 -------------
libgda/gda-db-view.h | 1 -
5 files changed, 89 insertions(+), 87 deletions(-)
---
diff --git a/libgda/gda-db-catalog.c b/libgda/gda-db-catalog.c
index 58557291b..7c67af571 100644
--- a/libgda/gda-db-catalog.c
+++ b/libgda/gda-db-catalog.c
@@ -571,6 +571,82 @@ gda_db_catalog_get_view (GdaDbCatalog *self,
return NULL;
}
+/*
+ * _gda_db_table_new_from_meta:
+ * @obj: a #GdaMetaDbObject
+ *
+ * Create new #GdaDbTable instance from the corresponding #GdaMetaDbObject
+ * object. If %NULL is passed this function works exactly as
+ * gda_db_table_new()
+ *
+ * This method should not be part of the public API.
+ *
+ * Since: 6.0
+ */
+static GdaDbTable*
+_gda_db_table_new_from_meta (GdaMetaDbObject *obj)
+{
+ if (!obj)
+ return gda_db_table_new();
+
+ if (obj->obj_type != GDA_META_DB_TABLE)
+ return NULL;
+
+ GdaMetaTable *metatable = GDA_META_TABLE(obj);
+ GdaDbTable *table = gda_db_table_new();
+
+ gda_db_base_set_names(GDA_DB_BASE(table),
+ obj->obj_catalog,
+ obj->obj_schema,
+ obj->obj_name);
+
+ GSList *it = NULL;
+ for (it = metatable->columns; it; it = it->next)
+ {
+ GdaDbColumn *column = gda_db_column_new_from_meta (GDA_META_TABLE_COLUMN(it->data));
+
+ gda_db_table_append_column(table,column);
+ }
+
+ it = NULL;
+ for (it = metatable->fk_list;it;it = it->next)
+ {
+ if (!GDA_META_TABLE_FOREIGN_KEY_IS_DECLARED(GDA_META_TABLE_FOREIGN_KEY(it->data)))
+ continue;
+
+ GdaDbFkey *fkey = gda_db_fkey_new_from_meta (GDA_META_TABLE_FOREIGN_KEY(it->data));
+
+ gda_db_table_append_fkey (table,fkey);
+
+ }
+
+ return table;
+}
+
+/*
+ * _gda_db_view_new_from_meta:
+ * @view: a #GdaMetaView instance
+ *
+ * Create new #GdaDbView object from the corresponding #GdaMetaView object
+ *
+ * This method should not be part of the public API.
+ *
+ * Returns: New instance of #GdaDbView
+ */
+static GdaDbView*
+_gda_db_view_new_from_meta (GdaMetaView *view)
+{
+ if (!view)
+ return gda_db_view_new();
+
+ GdaDbView *dbview = gda_db_view_new();
+
+ gda_db_view_set_defstring (dbview,view->view_def);
+ gda_db_view_set_replace (dbview,view->is_updatable);
+
+ return dbview;
+}
+
/**
* gda_db_catalog_parse_cnc:
* @self: a #GdaDbCatalog instance
@@ -618,7 +694,7 @@ gda_db_catalog_parse_cnc (GdaDbCatalog *self,
{
if(GDA_META_DB_OBJECT(it->data)->obj_type == GDA_META_DB_TABLE)
{
- GdaDbTable *table = gda_db_table_new_from_meta(it->data);
+ GdaDbTable *table = _gda_db_table_new_from_meta(it->data);
if (!table)
continue;
@@ -628,7 +704,7 @@ gda_db_catalog_parse_cnc (GdaDbCatalog *self,
if(GDA_META_DB_OBJECT(it->data)->obj_type == GDA_META_DB_VIEW)
{
- GdaDbView *view = gda_db_view_new_from_meta(it->data);
+ GdaDbView *view = _gda_db_view_new_from_meta(it->data);
priv->mp_views = g_list_append (priv->mp_views,view);
continue;
}
diff --git a/libgda/gda-db-table.c b/libgda/gda-db-table.c
index 9d0010ddb..e45e4e1b8 100644
--- a/libgda/gda-db-table.c
+++ b/libgda/gda-db-table.c
@@ -698,56 +698,6 @@ gda_db_table_create (GdaDbTable *self,
return res;
}
-/**
- * gda_db_table_new_from_meta:
- * @obj: a #GdaMetaDbObject
- *
- * Create new #GdaDbTable instance from the corresponding #GdaMetaDbObject
- * object. If %NULL is passed this function works exactly as
- * gda_db_table_new()
- *
- * Since: 6.0
- */
-GdaDbTable*
-gda_db_table_new_from_meta (GdaMetaDbObject *obj)
-{
- if (!obj)
- return gda_db_table_new();
-
- if (obj->obj_type != GDA_META_DB_TABLE)
- return NULL;
-
- GdaMetaTable *metatable = GDA_META_TABLE(obj);
- GdaDbTable *table = gda_db_table_new();
-
- gda_db_base_set_names(GDA_DB_BASE(table),
- obj->obj_catalog,
- obj->obj_schema,
- obj->obj_name);
-
- GSList *it = NULL;
- for (it = metatable->columns; it; it = it->next)
- {
- GdaDbColumn *column = gda_db_column_new_from_meta (GDA_META_TABLE_COLUMN(it->data));
-
- gda_db_table_append_column(table,column);
- }
-
- it = NULL;
- for (it = metatable->fk_list;it;it = it->next)
- {
- if (!GDA_META_TABLE_FOREIGN_KEY_IS_DECLARED(GDA_META_TABLE_FOREIGN_KEY(it->data)))
- continue;
-
- GdaDbFkey *fkey = gda_db_fkey_new_from_meta (GDA_META_TABLE_FOREIGN_KEY(it->data));
-
- gda_db_table_append_fkey (table,fkey);
-
- }
-
- return table;
-}
-
/**
* gda_db_table_append_column:
* @self: a #GdaDbTable instance
diff --git a/libgda/gda-db-table.h b/libgda/gda-db-table.h
index bab507642..d8bc4720d 100644
--- a/libgda/gda-db-table.h
+++ b/libgda/gda-db-table.h
@@ -51,7 +51,7 @@ typedef enum {
#define GDA_DB_TABLE_ERROR gda_db_table_error_quark()
GQuark gda_db_table_error_quark(void);
-GdaDbTable* gda_db_table_new (void);
+GdaDbTable* gda_db_table_new (void);
gboolean gda_db_table_is_valid (GdaDbTable *self);
GList* gda_db_table_get_columns (GdaDbTable *self);
GList* gda_db_table_get_fkeys (GdaDbTable *self);
@@ -64,24 +64,22 @@ void gda_db_table_set_is_temp (GdaDbTable *self,
gboolean istemp);
gboolean gda_db_table_prepare_create (GdaDbTable *self,
- GdaServerOperation *op,
- gboolean ifnotexists,
- GError **error);
+ GdaServerOperation *op,
+ gboolean ifnotexists,
+ GError **error);
gboolean gda_db_table_update (GdaDbTable *self,
- GdaMetaTable *obj,
- GdaConnection *cnc,
- GError **error);
+ GdaMetaTable *obj,
+ GdaConnection *cnc,
+ GError **error);
gboolean gda_db_table_create (GdaDbTable *self,
- GdaConnection *cnc,
- gboolean ifnotexists,
- GError **error);
-
-GdaDbTable *gda_db_table_new_from_meta (GdaMetaDbObject *obj);
+ GdaConnection *cnc,
+ gboolean ifnotexists,
+ GError **error);
void gda_db_table_append_fkey (GdaDbTable *self,
- GdaDbFkey *fkey);
+ GdaDbFkey *fkey);
G_END_DECLS
#endif /* end of include guard: GDA-DB-TABLE_H */
diff --git a/libgda/gda-db-view.c b/libgda/gda-db-view.c
index e415c96c2..9ac71432c 100644
--- a/libgda/gda-db-view.c
+++ b/libgda/gda-db-view.c
@@ -554,27 +554,6 @@ gda_db_view_prepare_create (GdaDbView *self,
return TRUE;
}
-/**
- * gda_db_view_new_from_meta:
- * @view: a #GdaMetaView instance
- *
- * Create new #GdaDbView object from the corresponding #GdaMetaView object
- *
- * Returns: New instance of #GdaDbView
- */
-GdaDbView*
-gda_db_view_new_from_meta (GdaMetaView *view)
-{
- if (!view)
- return gda_db_view_new();
-
- GdaDbView *dbview = gda_db_view_new();
-
- gda_db_view_set_defstring (dbview,view->view_def);
- gda_db_view_set_replace (dbview,view->is_updatable);
-
- return dbview;
-}
diff --git a/libgda/gda-db-view.h b/libgda/gda-db-view.h
index 104f00087..173d3d917 100644
--- a/libgda/gda-db-view.h
+++ b/libgda/gda-db-view.h
@@ -57,7 +57,6 @@ struct _GdaDbViewClass
*/
GdaDbView* gda_db_view_new (void);
-GdaDbView *gda_db_view_new_from_meta (GdaMetaView *view);
gboolean gda_db_view_get_istemp (GdaDbView *self);
void gda_db_view_set_istemp (GdaDbView *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]