[libgdamm] SqlBuilder: Add add_sub_select().



commit 7e23c10a7847e058e437915e51c1ad9d37ecb712
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue May 11 16:45:30 2010 +0200

     SqlBuilder: Add add_sub_select().
    
    * libgda/src/sqlbuilder.[hg|ccg]:  Wrap gda_sql_builder_add_sub_select().

 ChangeLog                 |    6 ++++++
 libgda/src/sqlbuilder.ccg |   14 +++++++++-----
 libgda/src/sqlbuilder.hg  |    8 ++++++++
 3 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c42a7d2..290fccb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2010-05-11  Murray Cumming  <murrayc murrayc com>
 
+    SqlBuilder: Add add_sub_select().
+
+	* libgda/src/sqlbuilder.[hg|ccg]:  Wrap gda_sql_builder_add_sub_select().
+
+2010-05-11  Murray Cumming  <murrayc murrayc com>
+
 	SqlBuilder: Add compound_add_sub_select().
 
 	* libgda/src/sqlbuilder.hg: Wrap gda_sql_builder_compound_add_sub_select().
diff --git a/libgda/src/sqlbuilder.ccg b/libgda/src/sqlbuilder.ccg
index baee22e..e75b204 100644
--- a/libgda/src/sqlbuilder.ccg
+++ b/libgda/src/sqlbuilder.ccg
@@ -1,7 +1,7 @@
 // -*- C++ -*- // this is for the .ccg, I realize gensig puts one in
 
 /* sqlparser.cc
- * 
+ *
  * Copyright 2003 libgdamm Development Team
  *
  * This library is free software; you can redistribute it and/or
@@ -42,7 +42,12 @@ static const char* string_or_null(const Glib::ustring& str)
 SqlBuilder::SqlBuilder(SqlStatementType type)
   : _CONSTRUCT("stmt-type", type)
 {
-  
+
+}
+
+guint SqlBuilder::add_sub_select(const SqlStatement& sqlst)
+{
+  return gda_sql_builder_add_sub_select(gobj(), 0, const_cast<GdaSqlStatement*>(sqlst.gobj()), false /* steal */);
 }
 
 guint SqlBuilder::add_id(const Glib::ustring& string)
@@ -104,7 +109,7 @@ void SqlBuilder::select_set_distinct(bool distinct)
 void SqlBuilder::select_set_limit(guint limit_count, guint offset)
 {
   const guint id_limit = add_expr(limit_count);
- 
+
   guint id_offset = 0;
   if(offset != 0)
     id_offset = add_expr(offset);
@@ -117,9 +122,8 @@ guint SqlBuilder::import_expression(const SqlExpr& expr)
 {
   return gda_sql_builder_import_expression(gobj(), 0, const_cast<GdaSqlExpr*>((expr).gobj()));
 }
-  
+
 
 } /* namespace Gda */
 
 } /* namespace Gnome */
-
diff --git a/libgda/src/sqlbuilder.hg b/libgda/src/sqlbuilder.hg
index 44dda63..b772ced 100644
--- a/libgda/src/sqlbuilder.hg
+++ b/libgda/src/sqlbuilder.hg
@@ -154,6 +154,14 @@ public:
     */
   guint add_function(const Glib::ustring& function_name, guint arg);
 
+
+  //TODO: Remove the stupid steal parameter.
+  guint 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);
+
   _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)
 
   // Statement API



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