[libgdamm] SqlBuilder: select_add_target() now takes a name instead of an ID.



commit 1ac9ddcb2aff973b9d6ce416cadd86f8f845e187
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Dec 4 14:27:39 2009 +0100

    SqlBuilder: select_add_target() now takes a name instead of an ID.
    
    * libgda/src/libgda_methods.defs: Regenerated
    * libgda/src/sqlbuilder.[hg|ccg]: select_add_target(): Take the
    table name as a string, using the new C function, and give the alias
    a default parameter instead of overloading.

 ChangeLog                      |    9 +++++++++
 libgda/src/libgda_methods.defs |   10 ++++++++++
 libgda/src/sqlbuilder.ccg      |    8 ++------
 libgda/src/sqlbuilder.hg       |   12 +++---------
 4 files changed, 24 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0d71d1f..d53b658 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-04  Murray Cumming  <murrayc murrayc com>
+
+	SqlBuilder: select_add_target() now takes a name instead of an ID.
+
+	* libgda/src/libgda_methods.defs: Regenerated
+	* libgda/src/sqlbuilder.[hg|ccg]: select_add_target(): Take the 
+	table name as a string, using the new C function, and give the alias 
+	a default parameter instead of overloading.
+
 2009-12-02  Murray Cumming  <murrayc murrayc-desktop>
 
 	SqlBuilder: Make set_field_value() and add_expr() templated.
diff --git a/libgda/src/libgda_methods.defs b/libgda/src/libgda_methods.defs
index c9c0c97..0eb426c 100644
--- a/libgda/src/libgda_methods.defs
+++ b/libgda/src/libgda_methods.defs
@@ -5309,6 +5309,16 @@
   (c-name "gda_sql_builder_select_add_target")
   (return-type "guint")
   (parameters
+    '("const-gchar*" "table_name")
+    '("const-gchar*" "alias")
+  )
+)
+
+(define-method select_add_target_id
+  (of-object "GdaSqlBuilder")
+  (c-name "gda_sql_builder_select_add_target_id")
+  (return-type "guint")
+  (parameters
     '("guint" "id")
     '("guint" "table_id")
     '("const-gchar*" "alias")
diff --git a/libgda/src/sqlbuilder.ccg b/libgda/src/sqlbuilder.ccg
index ffff21a..6c4cbff 100644
--- a/libgda/src/sqlbuilder.ccg
+++ b/libgda/src/sqlbuilder.ccg
@@ -71,15 +71,11 @@ guint SqlBuilder::add_function(const Glib::ustring& function_name, const Glib::A
   return gda_sql_builder_add_function_v(gobj(), 0, function_name.c_str(), args.data(), args.size());
 }
 
-guint SqlBuilder::select_add_target(guint table_id, const Glib::ustring& alias)
+guint SqlBuilder::select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias)
 {
-  return gda_sql_builder_select_add_target(gobj(), 0, table_id, alias.c_str());
+  return gda_sql_builder_select_add_target(gobj(), table_name.c_str(), alias.c_str());
 }
 
-guint SqlBuilder::select_add_target(guint table_id)
-{
-  return gda_sql_builder_select_add_target(gobj(), 0, table_id, 0);
-}
 
 guint SqlBuilder::select_join_targets(guint left_target_id, guint right_target_id, SqlSelectJoinType join_type, guint join_expr)
 {
diff --git a/libgda/src/sqlbuilder.hg b/libgda/src/sqlbuilder.hg
index cc37c9e..f7bef2f 100644
--- a/libgda/src/sqlbuilder.hg
+++ b/libgda/src/sqlbuilder.hg
@@ -130,7 +130,7 @@ public:
   guint add_cond(SqlOperatorType op, const Glib::ArrayHandle<guint>& op_ids);
 
   _IGNORE(gda_sql_builder_add_function, gda_sql_builder_add_function_v)
-  _IGNORE(gda_sql_builder_select_add_target, gda_sql_builder_select_join_targets)
+   _IGNORE(gda_sql_builder_select_join_targets)
   
   /** Builds a new expression which represents a function applied to some arguments.
     *
@@ -150,15 +150,9 @@ public:
    *
    * @return The ID of the new target, or 0 if there was an error.
    */
-  guint select_add_target(guint table_id, const Glib::ustring& alias);
+  guint select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias = Glib::ustring());
 
-  /** select_add_target with no alias given
-   * @param id The requested ID, or 0 if to be determined automatically
-   * @param table_id The ID of the expression holding a table reference
-   *
-   * @return The ID of the new target, or 0 if there was an error.
-   */
-  guint select_add_target(guint table_id);
+  _IGNORE(gda_sql_builder_select_add_target_id)
 
   /** Joins two targets in a SELECT statement
    * @param left_target_id The ID of the left target to use (not %0)



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