[libgdamm] Fix the build with libgda git master.



commit d4c3ba6ef499239127130efe07c8d1ed0e48264d
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jun 15 22:06:53 2010 +0200

    Fix the build with libgda git master.
    
    * libgda/src/libgda_methods.defs: Regenerated with h2defs.py.
    * libgda/src/sqlbuilder.[hg|ccg]: Use Id instead of guint for the IDs.
    It is just a typedef but it makes things clearer. libgda does this now too.
    Rename add_field_id() to add_field_value_id() and change the implementation
    of similar methods because the C functions were renamed (by me).

 ChangeLog                      |   10 +++
 libgda/src/libgda_methods.defs |  129 +++++++++++++++++++++++----------------
 libgda/src/sqlbuilder.ccg      |   35 ++++++-----
 libgda/src/sqlbuilder.hg       |   68 +++++++++++----------
 4 files changed, 141 insertions(+), 101 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f3a7994..0374f73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-15  Murray Cumming  <murrayc murrayc com>
+
+	Fix the build with libgda git master.
+
+	* libgda/src/libgda_methods.defs: Regenerated with h2defs.py.
+	* libgda/src/sqlbuilder.[hg|ccg]: Use Id instead of guint for the IDs.
+	It is just a typedef but it makes things clearer. libgda does this now too.
+	Rename add_field_id() to add_field_value_id() and change the implementation 
+	of similar methods because the C functions were renamed (by me).
+
 3.99.20:
 
 2010-05-20  Murray Cumming  <murrayc murrayc com>
diff --git a/libgda/src/libgda_methods.defs b/libgda/src/libgda_methods.defs
index faeb37a..796e22c 100644
--- a/libgda/src/libgda_methods.defs
+++ b/libgda/src/libgda_methods.defs
@@ -369,6 +369,7 @@
     '("read-only" "GDA_CONNECTION_OPTIONS_READ_ONLY")
     '("sql-identifiers-case-sensitive" "GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE")
     '("thread-safe" "GDA_CONNECTION_OPTIONS_THREAD_SAFE")
+    '("thread-isolated" "GDA_CONNECTION_OPTIONS_THREAD_ISOLATED")
   )
 )
 
@@ -393,6 +394,7 @@
     '("users" "GDA_CONNECTION_FEATURE_USERS")
     '("views" "GDA_CONNECTION_FEATURE_VIEWS")
     '("xa-transactions" "GDA_CONNECTION_FEATURE_XA_TRANSACTIONS")
+    '("multi-threading" "GDA_CONNECTION_FEATURE_MULTI_THREADING")
     '("last" "GDA_CONNECTION_FEATURE_LAST")
   )
 )
@@ -3323,6 +3325,17 @@
   )
 )
 
+(define-function gda_parse_string
+  (c-name "gda_parse_string")
+  (return-type "GdaStatement*")
+  (parameters
+    '("GdaConnection*" "cnc")
+    '("const-gchar*" "sql")
+    '("GdaSet**" "params")
+    '("GError**" "error")
+  )
+)
+
 (define-function gda_execute_select_command
   (c-name "gda_execute_select_command")
   (return-type "GdaDataModel*")
@@ -5215,16 +5228,26 @@
 (define-method add_id
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_id")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "string")
   )
 )
 
+(define-method add_field_id
+  (of-object "GdaSqlBuilder")
+  (c-name "gda_sql_builder_add_field_id")
+  (return-type "GdaSqlBuilderId")
+  (parameters
+    '("const-gchar*" "field_name")
+    '("const-gchar*" "table_name")
+  )
+)
+
 (define-method add_expr
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_expr")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaDataHandler*" "dh")
     '("GType" "type")
@@ -5235,7 +5258,7 @@
 (define-method add_expr_value
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_expr_value")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaDataHandler*" "dh")
     '("const-GValue*" "value")
@@ -5245,7 +5268,7 @@
 (define-method add_param
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_param")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "param_name")
     '("GType" "type")
@@ -5256,22 +5279,22 @@
 (define-method add_cond
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_cond")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaSqlOperatorType" "op")
-    '("guint" "op1")
-    '("guint" "op2")
-    '("guint" "op3")
+    '("GdaSqlBuilderId" "op1")
+    '("GdaSqlBuilderId" "op2")
+    '("GdaSqlBuilderId" "op3")
   )
 )
 
 (define-method add_cond_v
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_cond_v")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaSqlOperatorType" "op")
-    '("const-guint*" "op_ids")
+    '("const-GdaSqlBuilderId*" "op_ids")
     '("gint" "op_ids_size")
   )
 )
@@ -5279,7 +5302,7 @@
 (define-method add_function
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_function")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "func_name")
   )
@@ -5289,10 +5312,10 @@
 (define-method add_function_v
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_function_v")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "func_name")
-    '("const-guint*" "args")
+    '("const-GdaSqlBuilderId*" "args")
     '("gint" "args_size")
   )
 )
@@ -5300,7 +5323,7 @@
 (define-method add_sub_select
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_sub_select")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaSqlStatement*" "sqlst")
   )
@@ -5309,10 +5332,10 @@
 (define-method add_case
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_case")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
-    '("guint" "test_expr")
-    '("guint" "else_expr")
+    '("GdaSqlBuilderId" "test_expr")
+    '("GdaSqlBuilderId" "else_expr")
   )
   (varargs #t)
 )
@@ -5320,19 +5343,19 @@
 (define-method add_case_v
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_add_case_v")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
-    '("guint" "test_expr")
-    '("guint" "else_expr")
-    '("const-guint*" "when_array")
-    '("const-guint*" "then_array")
+    '("GdaSqlBuilderId" "test_expr")
+    '("GdaSqlBuilderId" "else_expr")
+    '("const-GdaSqlBuilderId*" "when_array")
+    '("const-GdaSqlBuilderId*" "then_array")
     '("gint" "args_size")
   )
 )
 
-(define-method add_field
+(define-method add_field_value
   (of-object "GdaSqlBuilder")
-  (c-name "gda_sql_builder_add_field")
+  (c-name "gda_sql_builder_add_field_value")
   (return-type "none")
   (parameters
     '("const-gchar*" "field_name")
@@ -5341,9 +5364,9 @@
   (varargs #t)
 )
 
-(define-method add_field_value
+(define-method add_field_value_as_gvalue
   (of-object "GdaSqlBuilder")
-  (c-name "gda_sql_builder_add_field_value")
+  (c-name "gda_sql_builder_add_field_value_as_gvalue")
   (return-type "none")
   (parameters
     '("const-gchar*" "field_name")
@@ -5351,38 +5374,38 @@
   )
 )
 
-(define-method set_table
+(define-method add_field_value_id
   (of-object "GdaSqlBuilder")
-  (c-name "gda_sql_builder_set_table")
+  (c-name "gda_sql_builder_add_field_value_id")
   (return-type "none")
   (parameters
-    '("const-gchar*" "table_name")
+    '("GdaSqlBuilderId" "field_id")
+    '("GdaSqlBuilderId" "value_id")
   )
 )
 
-(define-method set_where
+(define-method set_table
   (of-object "GdaSqlBuilder")
-  (c-name "gda_sql_builder_set_where")
+  (c-name "gda_sql_builder_set_table")
   (return-type "none")
   (parameters
-    '("guint" "cond_id")
+    '("const-gchar*" "table_name")
   )
 )
 
-(define-method add_field_id
+(define-method set_where
   (of-object "GdaSqlBuilder")
-  (c-name "gda_sql_builder_add_field_id")
+  (c-name "gda_sql_builder_set_where")
   (return-type "none")
   (parameters
-    '("guint" "field_id")
-    '("guint" "value_id")
+    '("GdaSqlBuilderId" "cond_id")
   )
 )
 
 (define-method select_add_field
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_select_add_field")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "field_name")
     '("const-gchar*" "table_name")
@@ -5393,7 +5416,7 @@
 (define-method select_add_target
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_select_add_target")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("const-gchar*" "table_name")
     '("const-gchar*" "alias")
@@ -5403,9 +5426,9 @@
 (define-method select_add_target_id
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_select_add_target_id")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
-    '("guint" "table_id")
+    '("GdaSqlBuilderId" "table_id")
     '("const-gchar*" "alias")
   )
 )
@@ -5413,12 +5436,12 @@
 (define-method select_join_targets
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_select_join_targets")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
-    '("guint" "left_target_id")
-    '("guint" "right_target_id")
+    '("GdaSqlBuilderId" "left_target_id")
+    '("GdaSqlBuilderId" "right_target_id")
     '("GdaSqlSelectJoinType" "join_type")
-    '("guint" "join_expr")
+    '("GdaSqlBuilderId" "join_expr")
   )
 )
 
@@ -5427,7 +5450,7 @@
   (c-name "gda_sql_builder_join_add_field")
   (return-type "none")
   (parameters
-    '("guint" "join_id")
+    '("GdaSqlBuilderId" "join_id")
     '("const-gchar*" "field_name")
   )
 )
@@ -5437,7 +5460,7 @@
   (c-name "gda_sql_builder_select_order_by")
   (return-type "none")
   (parameters
-    '("guint" "expr_id")
+    '("GdaSqlBuilderId" "expr_id")
     '("gboolean" "asc")
     '("const-gchar*" "collation_name")
   )
@@ -5449,7 +5472,7 @@
   (return-type "none")
   (parameters
     '("gboolean" "distinct")
-    '("guint" "expr_id")
+    '("GdaSqlBuilderId" "expr_id")
   )
 )
 
@@ -5458,8 +5481,8 @@
   (c-name "gda_sql_builder_select_set_limit")
   (return-type "none")
   (parameters
-    '("guint" "limit_count_expr_id")
-    '("guint" "limit_offest_expr_id")
+    '("GdaSqlBuilderId" "limit_count_expr_id")
+    '("GdaSqlBuilderId" "limit_offest_expr_id")
   )
 )
 
@@ -5468,7 +5491,7 @@
   (c-name "gda_sql_builder_select_set_having")
   (return-type "none")
   (parameters
-    '("guint" "cond_id")
+    '("GdaSqlBuilderId" "cond_id")
   )
 )
 
@@ -5477,7 +5500,7 @@
   (c-name "gda_sql_builder_select_group_by")
   (return-type "none")
   (parameters
-    '("guint" "expr_id")
+    '("GdaSqlBuilderId" "expr_id")
   )
 )
 
@@ -5504,14 +5527,14 @@
   (c-name "gda_sql_builder_export_expression")
   (return-type "GdaSqlExpr*")
   (parameters
-    '("guint" "id")
+    '("GdaSqlBuilderId" "id")
   )
 )
 
 (define-method import_expression
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_import_expression")
-  (return-type "guint")
+  (return-type "GdaSqlBuilderId")
   (parameters
     '("GdaSqlExpr*" "expr")
   )
diff --git a/libgda/src/sqlbuilder.ccg b/libgda/src/sqlbuilder.ccg
index 5de1ffa..f830e08 100644
--- a/libgda/src/sqlbuilder.ccg
+++ b/libgda/src/sqlbuilder.ccg
@@ -39,68 +39,71 @@ static const char* string_or_null(const Glib::ustring& str)
     return str.c_str();
 }
 
+//For the return types of gmmproc-generated code:
+typedef SqlBuilder::Id Id;
+
 SqlBuilder::SqlBuilder(SqlStatementType type)
   : _CONSTRUCT("stmt-type", type)
 {
 
 }
 
-guint SqlBuilder::add_sub_select(const SqlStatement& sqlst)
+SqlBuilder::Id SqlBuilder::add_sub_select(const SqlStatement& sqlst)
 {
   return gda_sql_builder_add_sub_select(gobj(), const_cast<GdaSqlStatement*>(sqlst.gobj()));
 }
 
-guint SqlBuilder::add_id(const Glib::ustring& string)
+SqlBuilder::Id SqlBuilder::add_id(const Glib::ustring& string)
 {
   return gda_sql_builder_add_id(gobj(), string.c_str());
 }
 
-guint SqlBuilder::add_expr_as_value(const Glib::RefPtr<DataHandler>& dh, const Value& value)
+SqlBuilder::Id SqlBuilder::add_expr_as_value(const Glib::RefPtr<DataHandler>& dh, const Value& value)
 {
   return gda_sql_builder_add_expr_value(gobj(), dh->gobj(), const_cast<GValue*>(value.gobj()));
 }
 
-guint SqlBuilder::add_expr_as_value(const Value& value)
+SqlBuilder::Id SqlBuilder::add_expr_as_value(const Value& value)
 {
   return gda_sql_builder_add_expr_value(gobj(), 0, const_cast<GValue*>(value.gobj()));
 }
 
-guint SqlBuilder::add_param(const Glib::ustring& param_name, GType type, bool nullok)
+SqlBuilder::Id SqlBuilder::add_param(const Glib::ustring& param_name, GType type, bool nullok)
 {
   return gda_sql_builder_add_param(gobj(), param_name.c_str(), type, nullok);
 }
 
-guint SqlBuilder::add_cond(SqlOperatorType op, guint op1, guint op2, guint op3)
+SqlBuilder::Id SqlBuilder::add_cond(SqlOperatorType op, Id op1, Id op2, Id op3)
 {
   return gda_sql_builder_add_cond(gobj(), (GdaSqlOperatorType) op, op1, op2, op3);
 }
 
-guint SqlBuilder::add_cond(SqlOperatorType op, const Glib::ArrayHandle<guint>& op_ids)
+SqlBuilder::Id SqlBuilder::add_cond(SqlOperatorType op, const Glib::ArrayHandle<Id>& op_ids)
 {
   return gda_sql_builder_add_cond_v(gobj(), (GdaSqlOperatorType) op, op_ids.data(), op_ids.size());
 }
 
-guint SqlBuilder::add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<guint>& args)
+SqlBuilder::Id SqlBuilder::add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<Id>& args)
 {
   return gda_sql_builder_add_function_v(gobj(), function_name.c_str(), args.data(), args.size());
 }
 
-guint SqlBuilder::add_function(const Glib::ustring& function_name, guint arg)
+SqlBuilder::Id SqlBuilder::add_function(const Glib::ustring& function_name, Id arg)
 {
   return gda_sql_builder_add_function(gobj(), function_name.c_str(), arg, 0, 0);
 }
 
-guint SqlBuilder::select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias)
+SqlBuilder::Id SqlBuilder::select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias)
 {
   return gda_sql_builder_select_add_target(gobj(), table_name.c_str(), string_or_null(alias.c_str()));
 }
 
-guint SqlBuilder::select_add_target_id(guint table_id, const Glib::ustring& alias)
+SqlBuilder::Id SqlBuilder::select_add_target_id(Id table_id, const Glib::ustring& alias)
 {
   return gda_sql_builder_select_add_target_id(gobj(), table_id, string_or_null(alias.c_str()));
 }
 
-guint SqlBuilder::select_join_targets(guint left_target_id, guint right_target_id, SqlSelectJoinType join_type, guint join_expr)
+SqlBuilder::Id SqlBuilder::select_join_targets(Id left_target_id, Id right_target_id, SqlSelectJoinType join_type, Id join_expr)
 {
   return gda_sql_builder_select_join_targets(gobj(), left_target_id, right_target_id, (GdaSqlSelectJoinType) join_type, join_expr);
 }
@@ -110,11 +113,11 @@ void SqlBuilder::select_set_distinct(bool distinct)
   gda_sql_builder_select_set_distinct(gobj(), distinct, 0);
 }
 
-void SqlBuilder::select_set_limit(guint limit_count, guint offset)
+void SqlBuilder::select_set_limit(Id limit_count, Id offset)
 {
-  const guint id_limit = add_expr(limit_count);
+  const Id id_limit = add_expr(limit_count);
 
-  guint id_offset = 0;
+  Id id_offset = 0;
   if(offset != 0)
     id_offset = add_expr(offset);
 
@@ -122,7 +125,7 @@ void SqlBuilder::select_set_limit(guint limit_count, guint offset)
 }
 
 
-guint SqlBuilder::import_expression(const SqlExpr& expr)
+SqlBuilder::Id SqlBuilder::import_expression(const SqlExpr& expr)
 {
   return gda_sql_builder_import_expression(gobj(), const_cast<GdaSqlExpr*>((expr).gobj()));
 }
diff --git a/libgda/src/sqlbuilder.hg b/libgda/src/sqlbuilder.hg
index 29d2b99..736f762 100644
--- a/libgda/src/sqlbuilder.hg
+++ b/libgda/src/sqlbuilder.hg
@@ -59,6 +59,10 @@ public:
   _IGNORE(gda_sql_builder_add_cond_v, gda_sql_builder_add_id)
   _IGNORE(gda_sql_builder_add_expr_value)
 
+  #m4 _EQUAL(GdaSqlBuilderId, Id)
+  //A duplicate of the GdsSqlBuilderId typedef in libgda's header, to avoid including the header here.
+  typedef guint Id;
+  
   // Expression API:
 
   /** Defines an expression which may be reused to build other parts of a statement.
@@ -66,7 +70,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_id(const Glib::ustring& string);
+  Id add_id(const Glib::ustring& string);
 
   /** Defines an expression in Builder which may be reused to build other parts of a statement.
    * @param dh The datahandler to use
@@ -77,7 +81,7 @@ public:
    * @return The ID of the new expression, or 0 if there was an error.
    */
   template <class ValueType>
-  guint add_expr(const Glib::RefPtr<DataHandler>& dh, const ValueType& value);
+  Id add_expr(const Glib::RefPtr<DataHandler>& dh, const ValueType& value);
 
   /** Defines an expression in Builder which may be reused to build other parts of a statement.
    * @param dh The datahandler to use
@@ -87,7 +91,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_expr_as_value(const Glib::RefPtr<DataHandler>& dh, const Value& value);
+  Id add_expr_as_value(const Glib::RefPtr<DataHandler>& dh, const Value& value);
 
   /** Defines an expression in Builder which may be reused to build other parts of a statement.
    * @param value: value to set the expression to
@@ -97,7 +101,7 @@ public:
    * @return The ID of the new expression, or 0 if there was an error.
    */
   template <class ValueType>
-  guint add_expr(const ValueType& value);
+  Id add_expr(const ValueType& value);
 
   /** Defines an expression in Builder which may be reused to build other parts of a statement.
    * @param value: value to set the expression to
@@ -106,7 +110,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_expr_as_value(const Value& value);
+  Id add_expr_as_value(const Value& value);
 
   /** Defines a parameter which may be reused to build other parts of a statement.
    * @param: param_name: name of the parameter
@@ -115,7 +119,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_param(const Glib::ustring& param_name, GType type, bool nullok = false);
+  Id add_param(const Glib::ustring& param_name, GType type, bool nullok = false);
 
   /** Builds a new expression which reprenents a condition (or operation).
    * @param op Type of condition
@@ -125,7 +129,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_cond(SqlOperatorType op, guint op1, guint op2 = 0, guint op3 = 0);
+  Id add_cond(SqlOperatorType op, Id op1, Id op2 = 0, Id op3 = 0);
 
   /** Builds a new expression which reprenents a condition (or operation).
    * @param op Type of condition
@@ -133,7 +137,7 @@ public:
    *
    * @return The ID of the new expression, or 0 if there was an error.
    */
-  guint add_cond(SqlOperatorType op, const Glib::ArrayHandle<guint>& op_ids);
+  Id add_cond(SqlOperatorType op, const Glib::ArrayHandle<Id>& op_ids);
 
   _IGNORE(gda_sql_builder_add_function, gda_sql_builder_add_function_v)
    _IGNORE(gda_sql_builder_select_join_targets)
@@ -145,7 +149,7 @@ public:
     *
     * @return The ID of the new target, or 0 if there was an error.
     */
-  guint add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<guint>& args);
+  Id add_function(const Glib::ustring& function_name, const Glib::ArrayHandle<Id>& args);
 
     /** Builds a new expression which represents a function applied to an argument.
     *
@@ -154,16 +158,16 @@ public:
     *
     * @return The ID of the new target, or 0 if there was an error.
     */
-  guint add_function(const Glib::ustring& function_name, guint arg);
+  Id add_function(const Glib::ustring& function_name, Id arg);
 
 
-  guint add_sub_select(const SqlStatement& sqlst);
+  Id add_sub_select(const SqlStatement& sqlst);
   _IGNORE(gda_sql_builder_add_sub_select)
 
-//TODO:  _WRAP_METHOD(guint gda_sql_builder_add_case (GdaSqlBuilder *builder, guint id,  guint test_expr, guint else_expr, ...);
-//TODO:  _WRAP_METHOD(guint gda_sql_builder_add_case_v (GdaSqlBuilder *builder, guint id,  guint test_expr, guint else_expr,  const guint *when_array, const guint *then_array, gint args_size);
+//TODO:  _WRAP_METHOD(Id gda_sql_builder_add_case (GdaSqlBuilder *builder, Id id,  Id test_expr, Id else_expr, ...);
+//TODO:  _WRAP_METHOD(Id gda_sql_builder_add_case_v (GdaSqlBuilder *builder, Id id,  Id test_expr, Id else_expr,  const Id *when_array, const Id *then_array, gint args_size);
 
-  _WRAP_METHOD(guint select_add_field(const Glib::ustring& field_name, const Glib::ustring& table_name, const Glib::ustring& alias = Glib::ustring()), gda_sql_builder_select_add_field)
+  _WRAP_METHOD(Id select_add_field(const Glib::ustring& field_name, const Glib::ustring& table_name, const Glib::ustring& alias = Glib::ustring()), gda_sql_builder_select_add_field)
 
   // Statement API
   /** Adds a new target to a SELECT statement
@@ -172,11 +176,11 @@ public:
    *
    * @return The ID of the new target, or 0 if there was an error.
    */
-  guint select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias = Glib::ustring());
+  Id select_add_target(const Glib::ustring& table_name, const Glib::ustring& alias = Glib::ustring());
   _IGNORE(gda_sql_builder_select_add_target)
 
   //For instance, to add a sub-query?
-  guint select_add_target_id(guint table_id, const Glib::ustring& alias = Glib::ustring());
+  Id select_add_target_id(Id table_id, const Glib::ustring& alias = Glib::ustring());
   _IGNORE(gda_sql_builder_select_add_target_id)
 
   /** Joins two targets in a SELECT statement
@@ -187,10 +191,10 @@ public:
    *
    * @return The ID of the new join, or 0 if there was an error.
    */
-  guint select_join_targets(guint left_target_id, guint right_target_id, SqlSelectJoinType join_type, guint join_expr = 0);
+  Id select_join_targets(Id left_target_id, Id right_target_id, SqlSelectJoinType join_type, Id join_expr = 0);
 
-  _WRAP_METHOD(void join_add_field(guint join_id, const Glib::ustring& field_name), gda_sql_builder_join_add_field)
-  _WRAP_METHOD(void select_order_by(guint expr_id, bool asc = true, const Glib::ustring& collation_name = Glib::ustring()), gda_sql_builder_select_order_by)
+  _WRAP_METHOD(void join_add_field(Id join_id, const Glib::ustring& field_name), gda_sql_builder_join_add_field)
+  _WRAP_METHOD(void select_order_by(Id expr_id, bool asc = true, const Glib::ustring& collation_name = Glib::ustring()), gda_sql_builder_select_order_by)
 
   /** Adds or removes a DISTINCT clause for a SELECT statement.
    * @param distinct Whether a DISTINCT clause should be in the SELECT statement.
@@ -198,43 +202,43 @@ public:
    */
   void select_set_distinct(bool distinct = true);
 
-  _WRAP_METHOD(void select_set_distinct(bool distinct, guint expr_id), gda_sql_builder_select_set_distinct)
+  _WRAP_METHOD(void select_set_distinct(bool distinct, Id expr_id), gda_sql_builder_select_set_distinct)
 
   /** Defines the maximum number of rows in the DataModel resulting from the execution of the built statement.
    * @param limit_count The number of rows that should be returned.
    * @param The offset of the first row that should appear in the result. (note that
    * this feature may not be supported by all the database providers.)
   */
-  void select_set_limit(guint limit_count, guint offset = 0);
+  void select_set_limit(Id limit_count, Id offset = 0);
 
-  _WRAP_METHOD(void select_set_limit_id(guint limit_count_expr_id, guint limit_offest_expr_id = 0), gda_sql_builder_select_set_limit)
+  _WRAP_METHOD(void select_set_limit_id(Id limit_count_expr_id, Id limit_offest_expr_id = 0), gda_sql_builder_select_set_limit)
 
-  _WRAP_METHOD(void select_set_having(guint cond_id), gda_sql_builder_select_set_having)
+  _WRAP_METHOD(void select_set_having(Id cond_id), gda_sql_builder_select_set_having)
 
-  _WRAP_METHOD(void select_group_by(guint expr_id), gda_sql_builder_select_group_by)
+  _WRAP_METHOD(void select_group_by(Id expr_id), gda_sql_builder_select_group_by)
   //TODO: Add select_group_by_field()?
 
   // General Statement API
   _WRAP_METHOD(void set_table(const Glib::ustring& table_name), gda_sql_builder_set_table)
-  _WRAP_METHOD(void set_where(guint cond_id), gda_sql_builder_set_where)
+  _WRAP_METHOD(void set_where(Id cond_id), gda_sql_builder_set_where)
 
-  _WRAP_METHOD(void add_field_id(guint field_id, guint value_id = 0), gda_sql_builder_add_field_id)
+  _WRAP_METHOD(void add_field_value_id(Id field_id, Id value_id = 0), gda_sql_builder_add_field_value_id)
 
   //TODO: Documentation:
   template <class ValueType>
   void add_field_value(const Glib::ustring& field_name, const ValueType& value);
 
-  _WRAP_METHOD(void add_field_value_as_value(const Glib::ustring& field_name, const Value& value), gda_sql_builder_add_field_value)
-  _IGNORE(gda_sql_builder_add_field)
+  _WRAP_METHOD(void add_field_value_as_value(const Glib::ustring& field_name, const Value& value), gda_sql_builder_add_field_value_as_gvalue)
+  _IGNORE(gda_sql_builder_add_field_value)
 
 
 /* COMPOUND SELECT Statement API */
   //TODO: Wrap the enum when we wrap GdaSqlStatementCompound _WRAP_METHOD(void compound_set_type(SqlStatementCompoundType compound_type), gda_sql_builder_compound_set_type)
   _WRAP_METHOD(void compound_add_sub_select(const SqlStatement& sqlst), gda_sql_builder_compound_add_sub_select)
 
-  _WRAP_METHOD(SqlExpr export_expression(guint id) const, gda_sql_builder_export_expression)
+  _WRAP_METHOD(SqlExpr export_expression(Id id) const, gda_sql_builder_export_expression)
 
-  guint import_expression(const SqlExpr& expr);
+  Id import_expression(const SqlExpr& expr);
   _IGNORE(gda_sql_builder_import_expression)
 };
 
@@ -248,14 +252,14 @@ void SqlBuilder::add_field_value(const Glib::ustring& field_name, const ValueTyp
 }
 
 template <class ValueType> inline
-guint SqlBuilder::add_expr(const Glib::RefPtr<DataHandler>& dh, const ValueType& value)
+SqlBuilder::Id SqlBuilder::add_expr(const Glib::RefPtr<DataHandler>& dh, const ValueType& value)
 {
   Gnome::Gda::Value gdavalue(value);
   return this->add_expr_as_value(dh, gdavalue);
 }
 
 template <class ValueType> inline
-guint SqlBuilder::add_expr(const ValueType& value)
+SqlBuilder::Id SqlBuilder::add_expr(const ValueType& value)
 {
   Gnome::Gda::Value gdavalue(value);
   return this->add_expr_as_value(gdavalue);



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