[libgdamm] Added new SqlBuilder methods.



commit de66157da1a1ef3bcfd37d1713a6a4560fa65b22
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu May 6 13:44:27 2010 +0200

    Added new SqlBuilder methods.
    
    * libgda/src/libgda_methods.defs: Regenerated with h2defs.py
    * libgda/src/sqlexpr.[hg|ccg]: Wrapped GdaSqlExpr as Gda::SqlExpr.
        This needs my change in libgda to register the boxed type.
        * libgda/src/sqlbuilder.hg: select_add_field(): Returns the ID now.
        Added export_expression() and import_expression().

 ChangeLog                      |   10 +
 libgda/src/filelist.am         |    1 +
 libgda/src/libgda_methods.defs | 1406 ++++++++++++++++++++++++++++++++++++----
 libgda/src/sqlbuilder.hg       |    5 +-
 libgda/src/sqlexpr.ccg         |   38 ++
 libgda/src/sqlexpr.hg          |   52 ++
 tools/m4/convert_libgdamm.m4   |    2 +
 7 files changed, 1370 insertions(+), 144 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 827d8e3..9ce2406 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2010-05-06  Murray Cumming  <murrayc murrayc com>
+
+    Added new SqlBuilder methods.
+
+	* libgda/src/libgda_methods.defs: Regenerated with h2defs.py
+	* libgda/src/sqlexpr.[hg|ccg]: Wrapped GdaSqlExpr as Gda::SqlExpr.
+    This needs my change in libgda to register the boxed type.
+    * libgda/src/sqlbuilder.hg: select_add_field(): Returns the ID now.
+    Added export_expression() and import_expression().
+
 2010-05-04  Murray Cumming  <murrayc murrayc com>
 
 	* libgda/libgdamm.h: Minor main text improvement.
diff --git a/libgda/src/filelist.am b/libgda/src/filelist.am
index 1bcb931..7cc68dd 100644
--- a/libgda/src/filelist.am
+++ b/libgda/src/filelist.am
@@ -40,6 +40,7 @@ files_hg =			\
 	serveroperation.hg	\
 	serverprovider.hg	\
 	set.hg			\
+	sqlexpr.hg   \
 	sqlparser.hg		\
 	sqlbuilder.hg   \
 	statement.hg		\
diff --git a/libgda/src/libgda_methods.defs b/libgda/src/libgda_methods.defs
index ee1e2bc..e002c46 100644
--- a/libgda/src/libgda_methods.defs
+++ b/libgda/src/libgda_methods.defs
@@ -62,13 +62,6 @@
   (gtype-id "GDA_TYPE_DATA_HANDLER")
 )
 
-(define-object DataMetaWrapper
-  (in-module "Gda")
-  (parent "GObject")
-  (c-name "GdaDataMetaWrapper")
-  (gtype-id "GDA_TYPE_DATA_META_WRAPPER")
-)
-
 (define-object DataModel
   (in-module "Gda")
   (c-name "GdaDataModel")
@@ -82,13 +75,6 @@
   (gtype-id "GDA_TYPE_DATA_MODEL_ARRAY")
 )
 
-(define-object DataModelBdb
-  (in-module "Gda")
-  (parent "GObject")
-  (c-name "GdaDataModelBdb")
-  (gtype-id "GDA_TYPE_DATA_MODEL_BDB")
-)
-
 (define-object DataModelDir
   (in-module "Gda")
   (parent "GObject")
@@ -96,13 +82,6 @@
   (gtype-id "GDA_TYPE_DATA_MODEL_DIR")
 )
 
-(define-object DataModelDsnList
-  (in-module "Gda")
-  (parent "GObject")
-  (c-name "GdaDataModelDsnList")
-  (gtype-id "GDA_TYPE_DATA_MODEL_DSN_LIST")
-)
-
 (define-object DataModelImport
   (in-module "Gda")
   (parent "GObject")
@@ -200,6 +179,13 @@
   (gtype-id "GDA_TYPE_SQL_BUILDER")
 )
 
+(define-object SqlParser
+  (in-module "Gda")
+  (parent "GObject")
+  (c-name "GdaSqlParser")
+  (gtype-id "GDA_TYPE_SQL_PARSER")
+)
+
 (define-object Statement
   (in-module "Gda")
   (parent "GObject")
@@ -288,6 +274,22 @@
   )
 )
 
+(define-enum PrefixDir
+  (in-module "Gda")
+  (c-name "GdaPrefixDir")
+  (gtype-id "GDA_TYPE_PREFIX_DIR")
+  (values
+    '("no-dir" "GDA_NO_DIR")
+    '("bin-dir" "GDA_BIN_DIR")
+    '("sbin-dir" "GDA_SBIN_DIR")
+    '("data-dir" "GDA_DATA_DIR")
+    '("locale-dir" "GDA_LOCALE_DIR")
+    '("lib-dir" "GDA_LIB_DIR")
+    '("libexec-dir" "GDA_LIBEXEC_DIR")
+    '("etc-dir" "GDA_ETC_DIR")
+  )
+)
+
 (define-enum ConfigError
   (in-module "Gda")
   (c-name "GdaConfigError")
@@ -456,16 +458,6 @@
   )
 )
 
-(define-enum DataMetaWrapperMode
-  (in-module "Gda")
-  (c-name "GdaDataMetaWrapperMode")
-  (gtype-id "GDA_TYPE_DATA_META_WRAPPER_MODE")
-  (values
-    '("lc" "GDA_DATA_META_WRAPPER_MODE_LC")
-    '("uc" "GDA_DATA_META_WRAPPER_MODE_UC")
-  )
-)
-
 (define-flags DataModelAccessFlags
   (in-module "Gda")
   (c-name "GdaDataModelAccessFlags")
@@ -542,19 +534,6 @@
   )
 )
 
-(define-enum Type
-  (in-module "Mod")
-  (c-name "ModType")
-  (gtype-id "MOD_TYPE_TYPE")
-  (values
-    '("first-query" "FIRST_QUERY")
-    '("ins-query" "INS_QUERY")
-    '("upd-query" "UPD_QUERY")
-    '("del-query" "DEL_QUERY")
-    '("nb-queries" "NB_QUERIES")
-  )
-)
-
 (define-enum DataSelectError
   (in-module "Gda")
   (c-name "GdaDataSelectError")
@@ -922,6 +901,170 @@
   )
 )
 
+(define-enum SqlParserError
+  (in-module "Gda")
+  (c-name "GdaSqlParserError")
+  (gtype-id "GDA_TYPE_SQL_PARSER_ERROR")
+  (values
+    '("syntax-error" "GDA_SQL_PARSER_SYNTAX_ERROR")
+    '("overflow-error" "GDA_SQL_PARSER_OVERFLOW_ERROR")
+    '("empty-sql-error" "GDA_SQL_PARSER_EMPTY_SQL_ERROR")
+  )
+)
+
+(define-enum SqlParserMode
+  (in-module "Gda")
+  (c-name "GdaSqlParserMode")
+  (gtype-id "GDA_TYPE_SQL_PARSER_MODE")
+  (values
+    '("parse" "GDA_SQL_PARSER_MODE_PARSE")
+    '("delimit" "GDA_SQL_PARSER_MODE_DELIMIT")
+  )
+)
+
+(define-enum SqlParserFlavour
+  (in-module "Gda")
+  (c-name "GdaSqlParserFlavour")
+  (gtype-id "GDA_TYPE_SQL_PARSER_FLAVOUR")
+  (values
+    '("standard" "GDA_SQL_PARSER_FLAVOUR_STANDARD")
+    '("sqlite" "GDA_SQL_PARSER_FLAVOUR_SQLITE")
+    '("mysql" "GDA_SQL_PARSER_FLAVOUR_MYSQL")
+    '("oracle" "GDA_SQL_PARSER_FLAVOUR_ORACLE")
+    '("postgresql" "GDA_SQL_PARSER_FLAVOUR_POSTGRESQL")
+  )
+)
+
+(define-enum SqlStatementCompoundType
+  (in-module "Gda")
+  (c-name "GdaSqlStatementCompoundType")
+  (gtype-id "GDA_TYPE_SQL_STATEMENT_COMPOUND_TYPE")
+  (values
+    '("union" "GDA_SQL_STATEMENT_COMPOUND_UNION")
+    '("union-all" "GDA_SQL_STATEMENT_COMPOUND_UNION_ALL")
+    '("intersect" "GDA_SQL_STATEMENT_COMPOUND_INTERSECT")
+    '("intersect-all" "GDA_SQL_STATEMENT_COMPOUND_INTERSECT_ALL")
+    '("except" "GDA_SQL_STATEMENT_COMPOUND_EXCEPT")
+    '("except-all" "GDA_SQL_STATEMENT_COMPOUND_EXCEPT_ALL")
+  )
+)
+
+(define-enum SqlError
+  (in-module "Gda")
+  (c-name "GdaSqlError")
+  (gtype-id "GDA_TYPE_SQL_ERROR")
+  (values
+    '("structure-contents-error" "GDA_SQL_STRUCTURE_CONTENTS_ERROR")
+    '("malformed-identifier-error" "GDA_SQL_MALFORMED_IDENTIFIER_ERROR")
+    '("missing-identifier-error" "GDA_SQL_MISSING_IDENTIFIER_ERROR")
+    '("validation-error" "GDA_SQL_VALIDATION_ERROR")
+  )
+)
+
+(define-enum SqlStatementType
+  (in-module "Gda")
+  (c-name "GdaSqlStatementType")
+  (gtype-id "GDA_TYPE_SQL_STATEMENT_TYPE")
+  (values
+    '("select" "GDA_SQL_STATEMENT_SELECT")
+    '("insert" "GDA_SQL_STATEMENT_INSERT")
+    '("update" "GDA_SQL_STATEMENT_UPDATE")
+    '("delete" "GDA_SQL_STATEMENT_DELETE")
+    '("compound" "GDA_SQL_STATEMENT_COMPOUND")
+    '("begin" "GDA_SQL_STATEMENT_BEGIN")
+    '("rollback" "GDA_SQL_STATEMENT_ROLLBACK")
+    '("commit" "GDA_SQL_STATEMENT_COMMIT")
+    '("savepoint" "GDA_SQL_STATEMENT_SAVEPOINT")
+    '("rollback-savepoint" "GDA_SQL_STATEMENT_ROLLBACK_SAVEPOINT")
+    '("delete-savepoint" "GDA_SQL_STATEMENT_DELETE_SAVEPOINT")
+    '("unknown" "GDA_SQL_STATEMENT_UNKNOWN")
+    '("none" "GDA_SQL_STATEMENT_NONE")
+  )
+)
+
+(define-enum SqlAnyPartType
+  (in-module "Gda")
+  (c-name "GdaSqlAnyPartType")
+  (gtype-id "GDA_TYPE_SQL_ANY_PART_TYPE")
+  (values
+    '("stmt-select" "GDA_SQL_ANY_STMT_SELECT")
+    '("stmt-insert" "GDA_SQL_ANY_STMT_INSERT")
+    '("stmt-update" "GDA_SQL_ANY_STMT_UPDATE")
+    '("stmt-delete" "GDA_SQL_ANY_STMT_DELETE")
+    '("stmt-compound" "GDA_SQL_ANY_STMT_COMPOUND")
+    '("stmt-begin" "GDA_SQL_ANY_STMT_BEGIN")
+    '("stmt-rollback" "GDA_SQL_ANY_STMT_ROLLBACK")
+    '("stmt-commit" "GDA_SQL_ANY_STMT_COMMIT")
+    '("stmt-savepoint" "GDA_SQL_ANY_STMT_SAVEPOINT")
+    '("stmt-rollback-savepoint" "GDA_SQL_ANY_STMT_ROLLBACK_SAVEPOINT")
+    '("stmt-delete-savepoint" "GDA_SQL_ANY_STMT_DELETE_SAVEPOINT")
+    '("stmt-unknown" "GDA_SQL_ANY_STMT_UNKNOWN")
+    '("expr" "GDA_SQL_ANY_EXPR")
+    '("sql-field" "GDA_SQL_ANY_SQL_FIELD")
+    '("sql-table" "GDA_SQL_ANY_SQL_TABLE")
+    '("sql-function" "GDA_SQL_ANY_SQL_FUNCTION")
+    '("sql-operation" "GDA_SQL_ANY_SQL_OPERATION")
+    '("sql-case" "GDA_SQL_ANY_SQL_CASE")
+    '("sql-select-field" "GDA_SQL_ANY_SQL_SELECT_FIELD")
+    '("sql-select-target" "GDA_SQL_ANY_SQL_SELECT_TARGET")
+    '("sql-select-join" "GDA_SQL_ANY_SQL_SELECT_JOIN")
+    '("sql-select-from" "GDA_SQL_ANY_SQL_SELECT_FROM")
+    '("sql-select-order" "GDA_SQL_ANY_SQL_SELECT_ORDER")
+  )
+)
+
+(define-enum SqlOperatorType
+  (in-module "Gda")
+  (c-name "GdaSqlOperatorType")
+  (gtype-id "GDA_TYPE_SQL_OPERATOR_TYPE")
+  (values
+    '("and" "GDA_SQL_OPERATOR_TYPE_AND")
+    '("or" "GDA_SQL_OPERATOR_TYPE_OR")
+    '("eq" "GDA_SQL_OPERATOR_TYPE_EQ")
+    '("is" "GDA_SQL_OPERATOR_TYPE_IS")
+    '("like" "GDA_SQL_OPERATOR_TYPE_LIKE")
+    '("between" "GDA_SQL_OPERATOR_TYPE_BETWEEN")
+    '("gt" "GDA_SQL_OPERATOR_TYPE_GT")
+    '("lt" "GDA_SQL_OPERATOR_TYPE_LT")
+    '("geq" "GDA_SQL_OPERATOR_TYPE_GEQ")
+    '("leq" "GDA_SQL_OPERATOR_TYPE_LEQ")
+    '("diff" "GDA_SQL_OPERATOR_TYPE_DIFF")
+    '("regexp" "GDA_SQL_OPERATOR_TYPE_REGEXP")
+    '("regexp-ci" "GDA_SQL_OPERATOR_TYPE_REGEXP_CI")
+    '("not-regexp" "GDA_SQL_OPERATOR_TYPE_NOT_REGEXP")
+    '("not-regexp-ci" "GDA_SQL_OPERATOR_TYPE_NOT_REGEXP_CI")
+    '("similar" "GDA_SQL_OPERATOR_TYPE_SIMILAR")
+    '("isnull" "GDA_SQL_OPERATOR_TYPE_ISNULL")
+    '("isnotnull" "GDA_SQL_OPERATOR_TYPE_ISNOTNULL")
+    '("not" "GDA_SQL_OPERATOR_TYPE_NOT")
+    '("in" "GDA_SQL_OPERATOR_TYPE_IN")
+    '("notin" "GDA_SQL_OPERATOR_TYPE_NOTIN")
+    '("concat" "GDA_SQL_OPERATOR_TYPE_CONCAT")
+    '("plus" "GDA_SQL_OPERATOR_TYPE_PLUS")
+    '("minus" "GDA_SQL_OPERATOR_TYPE_MINUS")
+    '("star" "GDA_SQL_OPERATOR_TYPE_STAR")
+    '("div" "GDA_SQL_OPERATOR_TYPE_DIV")
+    '("rem" "GDA_SQL_OPERATOR_TYPE_REM")
+    '("bitand" "GDA_SQL_OPERATOR_TYPE_BITAND")
+    '("bitor" "GDA_SQL_OPERATOR_TYPE_BITOR")
+    '("bitnot" "GDA_SQL_OPERATOR_TYPE_BITNOT")
+  )
+)
+
+(define-enum SqlSelectJoinType
+  (in-module "Gda")
+  (c-name "GdaSqlSelectJoinType")
+  (gtype-id "GDA_TYPE_SQL_SELECT_JOIN_TYPE")
+  (values
+    '("cross" "GDA_SQL_SELECT_JOIN_CROSS")
+    '("natural" "GDA_SQL_SELECT_JOIN_NATURAL")
+    '("inner" "GDA_SQL_SELECT_JOIN_INNER")
+    '("left" "GDA_SQL_SELECT_JOIN_LEFT")
+    '("right" "GDA_SQL_SELECT_JOIN_RIGHT")
+    '("full" "GDA_SQL_SELECT_JOIN_FULL")
+  )
+)
+
 
 ;; From gda-attributes-manager.h
 
@@ -1069,6 +1212,24 @@
 
 
 
+;; From gda-binreloc.h
+
+(define-function gda_gbr_init
+  (c-name "gda_gbr_init")
+  (return-type "none")
+)
+
+(define-function gda_gbr_get_file_path
+  (c-name "gda_gbr_get_file_path")
+  (return-type "gchar*")
+  (parameters
+    '("GdaPrefixDir" "where")
+  )
+  (varargs #t)
+)
+
+
+
 ;; From gda-blob-op.h
 
 (define-function gda_blob_op_get_type
@@ -1899,10 +2060,6 @@
 
 
 
-;; From gda-connection-internal.h
-
-
-
 ;; From gda-connection-private.h
 
 (define-method internal_set_provider_data
@@ -2069,14 +2226,6 @@
 
 
 
-;; From gda-connection-sqlite.h
-
-
-
-;; From gda-custom-marshal.h
-
-
-
 ;; From gda-data-access-wrapper.h
 
 (define-function gda_data_access_wrapper_get_type
@@ -2219,10 +2368,6 @@
 
 
 
-;; From gda-data-meta-wrapper.h
-
-
-
 ;; From gda-data-model-array.h
 
 (define-function gda_data_model_array_get_type
@@ -2284,37 +2429,6 @@
 
 
 
-;; From gda-data-model-bdb.h
-
-(define-function gda_data_model_bdb_get_type
-  (c-name "gda_data_model_bdb_get_type")
-  (return-type "GType")
-)
-
-(define-function gda_data_model_bdb_new
-  (c-name "gda_data_model_bdb_new")
-  (is-constructor-of "GdaDataModelBdb")
-  (return-type "GdaDataModel*")
-  (parameters
-    '("const-gchar*" "filename")
-    '("const-gchar*" "db_name")
-  )
-)
-
-(define-method get_errors
-  (of-object "GdaDataModelBdb")
-  (c-name "gda_data_model_bdb_get_errors")
-  (return-type "const-GSList*")
-)
-
-(define-method clean_errors
-  (of-object "GdaDataModelBdb")
-  (c-name "gda_data_model_bdb_clean_errors")
-  (return-type "none")
-)
-
-
-
 ;; From gda-data-model-dir.h
 
 (define-function gda_data_model_dir_get_type
@@ -2345,15 +2459,6 @@
 
 
 
-;; From gda-data-model-dsn-list.h
-
-(define-function gda_data_model_dsn_list_get_type
-  (c-name "gda_data_model_dsn_list_get_type")
-  (return-type "GType")
-)
-
-
-
 ;; From gda-data-model-extra.h
 
 (define-method row_inserted
@@ -3109,10 +3214,6 @@
 
 
 
-;; From gda-data-select-extra.h
-
-
-
 ;; From gda-data-select.h
 
 (define-function gda_data_select_get_type
@@ -3904,10 +4005,6 @@
 
 
 
-;; From gda-meta-store-extra.h
-
-
-
 ;; From gda-meta-store.h
 
 (define-function gda_meta_store_get_type
@@ -4231,32 +4328,6 @@
 
 
 
-;; From gda-meta-struct-private.h
-
-(define-method add_db_object
-  (of-object "GdaMetaStruct")
-  (c-name "gda_meta_struct_add_db_object")
-  (return-type "GdaMetaDbObject*")
-  (parameters
-    '("GdaMetaDbObject*" "dbo")
-    '("GError**" "error")
-  )
-)
-
-(define-method load_from_xml_file
-  (of-object "GdaMetaStruct")
-  (c-name "gda_meta_struct_load_from_xml_file")
-  (return-type "gboolean")
-  (parameters
-    '("const-gchar*" "catalog")
-    '("const-gchar*" "schema")
-    '("const-gchar*" "xml_spec_file")
-    '("GError**" "error")
-  )
-)
-
-
-
 ;; From gda-mutex.h
 
 (define-function gda_mutex_new
@@ -4668,10 +4739,6 @@
 
 
 
-;; From gda-server-operation-private.h
-
-
-
 ;; From gda-server-provider-extra.h
 
 (define-method internal_get_parser
@@ -5330,7 +5397,7 @@
 (define-method select_add_field
   (of-object "GdaSqlBuilder")
   (c-name "gda_sql_builder_select_add_field")
-  (return-type "none")
+  (return-type "guint")
   (parameters
     '("const-gchar*" "field_name")
     '("const-gchar*" "table_name")
@@ -5450,6 +5517,25 @@
   )
 )
 
+(define-method export_expression
+  (of-object "GdaSqlBuilder")
+  (c-name "gda_sql_builder_export_expression")
+  (return-type "GdaSqlExpr*")
+  (parameters
+    '("guint" "id")
+  )
+)
+
+(define-method import_expression
+  (of-object "GdaSqlBuilder")
+  (c-name "gda_sql_builder_import_expression")
+  (return-type "guint")
+  (parameters
+    '("guint" "id")
+    '("GdaSqlExpr*" "expr")
+  )
+)
+
 
 
 ;; From gda-statement-extra.h
@@ -5993,10 +6079,6 @@
 
 
 
-;; From gda-types.h
-
-
-
 ;; From gda-util.h
 
 (define-function gda_g_type_to_string
@@ -6852,3 +6934,1041 @@
 )
 
 
+
+;; From gda-sql-parser-enum-types.h
+
+(define-function gda_sql_parser_error_get_type
+  (c-name "gda_sql_parser_error_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_parser_mode_get_type
+  (c-name "gda_sql_parser_mode_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_parser_flavour_get_type
+  (c-name "gda_sql_parser_flavour_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_error_get_type
+  (c-name "gda_sql_error_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_statement_type_get_type
+  (c-name "gda_sql_statement_type_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_any_part_type_get_type
+  (c-name "gda_sql_any_part_type_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_statement_compound_type_get_type
+  (c-name "gda_sql_statement_compound_type_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_operator_type_get_type
+  (c-name "gda_sql_operator_type_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_select_join_type_get_type
+  (c-name "gda_sql_select_join_type_get_type")
+  (return-type "GType")
+)
+
+
+
+;; From gda-sql-parser.h
+
+(define-function gda_sql_parser_get_type
+  (c-name "gda_sql_parser_get_type")
+  (return-type "GType")
+)
+
+(define-function gda_sql_parser_new
+  (c-name "gda_sql_parser_new")
+  (is-constructor-of "GdaSqlParser")
+  (return-type "GdaSqlParser*")
+)
+
+(define-method parse_string
+  (of-object "GdaSqlParser")
+  (c-name "gda_sql_parser_parse_string")
+  (return-type "GdaStatement*")
+  (parameters
+    '("const-gchar*" "sql")
+    '("const-gchar**" "remain")
+    '("GError**" "error")
+  )
+)
+
+(define-method parse_string_as_batch
+  (of-object "GdaSqlParser")
+  (c-name "gda_sql_parser_parse_string_as_batch")
+  (return-type "GdaBatch*")
+  (parameters
+    '("const-gchar*" "sql")
+    '("const-gchar**" "remain")
+    '("GError**" "error")
+  )
+)
+
+(define-method parse_file_as_batch
+  (of-object "GdaSqlParser")
+  (c-name "gda_sql_parser_parse_file_as_batch")
+  (return-type "GdaBatch*")
+  (parameters
+    '("const-gchar*" "filename")
+    '("GError**" "error")
+  )
+)
+
+(define-method set_syntax_error
+  (of-object "GdaSqlParser")
+  (c-name "gda_sql_parser_set_syntax_error")
+  (return-type "none")
+)
+
+(define-method set_overflow_error
+  (of-object "GdaSqlParser")
+  (c-name "gda_sql_parser_set_overflow_error")
+  (return-type "none")
+)
+
+
+
+;; From gda-sql-statement.h
+
+
+
+;; From gda-statement-struct-compound.h
+
+(define-method compound_set_type
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_compound_set_type")
+  (return-type "none")
+  (parameters
+    '("GdaSqlStatementCompoundType" "type")
+  )
+)
+
+(define-method compound_take_stmt
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_compound_take_stmt")
+  (return-type "none")
+  (parameters
+    '("GdaSqlStatement*" "s")
+  )
+)
+
+
+
+;; From gda-statement-struct-decl.h
+
+(define-method foreach
+  (of-object "GdaSqlAnyPart")
+  (c-name "gda_sql_any_part_foreach")
+  (return-type "gboolean")
+  (parameters
+    '("GdaSqlForeachFunc" "func")
+    '("gpointer" "data")
+    '("GError**" "error")
+  )
+)
+
+(define-method check_structure
+  (of-object "GdaSqlAnyPart")
+  (c-name "gda_sql_any_part_check_structure")
+  (return-type "gboolean")
+  (parameters
+    '("GError**" "error")
+  )
+)
+
+
+
+;; From gda-statement-struct-delete.h
+
+(define-method delete_take_table_name
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_delete_take_table_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method delete_take_condition
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_delete_take_condition")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "cond")
+  )
+)
+
+
+
+;; From gda-statement-struct.h
+
+(define-function gda_sql_statement_new
+  (c-name "gda_sql_statement_new")
+  (is-constructor-of "GdaSqlStatement")
+  (return-type "GdaSqlStatement*")
+  (parameters
+    '("GdaSqlStatementType" "type")
+  )
+)
+
+(define-method copy
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_copy")
+  (return-type "GdaSqlStatement*")
+)
+
+(define-method free
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_free")
+  (return-type "none")
+)
+
+(define-method serialize
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_serialize")
+  (return-type "gchar*")
+)
+
+(define-method to_string
+  (of-object "GdaSqlStatementType")
+  (c-name "gda_sql_statement_type_to_string")
+  (return-type "const-gchar*")
+)
+
+(define-function gda_sql_statement_string_to_type
+  (c-name "gda_sql_statement_string_to_type")
+  (return-type "GdaSqlStatementType")
+  (parameters
+    '("const-gchar*" "type")
+  )
+)
+
+(define-method check_structure
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_check_structure")
+  (return-type "gboolean")
+  (parameters
+    '("GError**" "error")
+  )
+)
+
+(define-method check_validity
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_check_validity")
+  (return-type "gboolean")
+  (parameters
+    '("GdaConnection*" "cnc")
+    '("GError**" "error")
+  )
+)
+
+(define-method check_clean
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_check_clean")
+  (return-type "none")
+)
+
+(define-method normalize
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_normalize")
+  (return-type "gboolean")
+  (parameters
+    '("GdaConnection*" "cnc")
+    '("GError**" "error")
+  )
+)
+
+(define-function gda_sql_statement_get_contents_infos
+  (c-name "gda_sql_statement_get_contents_infos")
+  (return-type "GdaSqlStatementContentsInfo*")
+  (parameters
+    '("GdaSqlStatementType" "type")
+  )
+)
+
+
+
+;; From gda-statement-struct-insert.h
+
+(define-method insert_take_table_name
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_table_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method insert_take_on_conflict
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_on_conflict")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method insert_take_fields_list
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_fields_list")
+  (return-type "none")
+  (parameters
+    '("GSList*" "list")
+  )
+)
+
+(define-method insert_take_1_values_list
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_1_values_list")
+  (return-type "none")
+  (parameters
+    '("GSList*" "list")
+  )
+)
+
+(define-method insert_take_extra_values_list
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_extra_values_list")
+  (return-type "none")
+  (parameters
+    '("GSList*" "list")
+  )
+)
+
+(define-method insert_take_select
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_insert_take_select")
+  (return-type "none")
+  (parameters
+    '("GdaSqlStatement*" "select")
+  )
+)
+
+
+
+;; From gda-statement-struct-parts.h
+
+(define-function gda_sql_expr_new
+  (c-name "gda_sql_expr_new")
+  (is-constructor-of "GdaSqlExpr")
+  (return-type "GdaSqlExpr*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlExpr")
+  (c-name "gda_sql_expr_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlExpr")
+  (c-name "gda_sql_expr_copy")
+  (return-type "GdaSqlExpr*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlExpr")
+  (c-name "gda_sql_expr_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_select
+  (of-object "GdaSqlExpr")
+  (c-name "gda_sql_expr_take_select")
+  (return-type "none")
+  (parameters
+    '("GdaSqlStatement*" "stmt")
+  )
+)
+
+(define-function gda_sql_field_new
+  (c-name "gda_sql_field_new")
+  (is-constructor-of "GdaSqlField")
+  (return-type "GdaSqlField*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlField")
+  (c-name "gda_sql_field_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlField")
+  (c-name "gda_sql_field_copy")
+  (return-type "GdaSqlField*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlField")
+  (c-name "gda_sql_field_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_name
+  (of-object "GdaSqlField")
+  (c-name "gda_sql_field_take_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-function gda_sql_table_new
+  (c-name "gda_sql_table_new")
+  (is-constructor-of "GdaSqlTable")
+  (return-type "GdaSqlTable*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlTable")
+  (c-name "gda_sql_table_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlTable")
+  (c-name "gda_sql_table_copy")
+  (return-type "GdaSqlTable*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlTable")
+  (c-name "gda_sql_table_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_name
+  (of-object "GdaSqlTable")
+  (c-name "gda_sql_table_take_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-function gda_sql_function_new
+  (c-name "gda_sql_function_new")
+  (is-constructor-of "GdaSqlFunction")
+  (return-type "GdaSqlFunction*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_copy")
+  (return-type "GdaSqlFunction*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_serialize")
+  (return-type "gchar*")
+)
+
+(define-method check_clean
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_check_clean")
+  (return-type "none")
+)
+
+(define-method take_name
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_take_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_args_list
+  (of-object "GdaSqlFunction")
+  (c-name "gda_sql_function_take_args_list")
+  (return-type "none")
+  (parameters
+    '("GSList*" "args")
+  )
+)
+
+(define-function gda_sql_operation_new
+  (c-name "gda_sql_operation_new")
+  (is-constructor-of "GdaSqlOperation")
+  (return-type "GdaSqlOperation*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlOperation")
+  (c-name "gda_sql_operation_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlOperation")
+  (c-name "gda_sql_operation_copy")
+  (return-type "GdaSqlOperation*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlOperation")
+  (c-name "gda_sql_operation_serialize")
+  (return-type "gchar*")
+)
+
+(define-function gda_sql_operation_operator_to_string
+  (c-name "gda_sql_operation_operator_to_string")
+  (return-type "const-gchar*")
+  (parameters
+    '("GdaSqlOperatorType" "op")
+  )
+)
+
+(define-function gda_sql_operation_operator_from_string
+  (c-name "gda_sql_operation_operator_from_string")
+  (return-type "GdaSqlOperatorType")
+  (parameters
+    '("const-gchar*" "op")
+  )
+)
+
+(define-function gda_sql_case_new
+  (c-name "gda_sql_case_new")
+  (is-constructor-of "GdaSqlCase")
+  (return-type "GdaSqlCase*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlCase")
+  (c-name "gda_sql_case_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlCase")
+  (c-name "gda_sql_case_copy")
+  (return-type "GdaSqlCase*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlCase")
+  (c-name "gda_sql_case_serialize")
+  (return-type "gchar*")
+)
+
+(define-function gda_sql_select_field_new
+  (c-name "gda_sql_select_field_new")
+  (is-constructor-of "GdaSqlSelectField")
+  (return-type "GdaSqlSelectField*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_copy")
+  (return-type "GdaSqlSelectField*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_star_value
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_take_star_value")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_expr
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_take_expr")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "expr")
+  )
+)
+
+(define-method take_alias
+  (of-object "GdaSqlSelectField")
+  (c-name "gda_sql_select_field_take_alias")
+  (return-type "none")
+  (parameters
+    '("GValue*" "alias")
+  )
+)
+
+(define-function gda_sql_select_target_new
+  (c-name "gda_sql_select_target_new")
+  (is-constructor-of "GdaSqlSelectTarget")
+  (return-type "GdaSqlSelectTarget*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_copy")
+  (return-type "GdaSqlSelectTarget*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_table_name
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_take_table_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_select
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_take_select")
+  (return-type "none")
+  (parameters
+    '("GdaSqlStatement*" "stmt")
+  )
+)
+
+(define-method take_alias
+  (of-object "GdaSqlSelectTarget")
+  (c-name "gda_sql_select_target_take_alias")
+  (return-type "none")
+  (parameters
+    '("GValue*" "alias")
+  )
+)
+
+(define-function gda_sql_select_join_new
+  (c-name "gda_sql_select_join_new")
+  (is-constructor-of "GdaSqlSelectJoin")
+  (return-type "GdaSqlSelectJoin*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlSelectJoin")
+  (c-name "gda_sql_select_join_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlSelectJoin")
+  (c-name "gda_sql_select_join_copy")
+  (return-type "GdaSqlSelectJoin*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlSelectJoin")
+  (c-name "gda_sql_select_join_serialize")
+  (return-type "gchar*")
+)
+
+(define-method to_string
+  (of-object "GdaSqlSelectJoinType")
+  (c-name "gda_sql_select_join_type_to_string")
+  (return-type "const-gchar*")
+)
+
+(define-function gda_sql_select_from_new
+  (c-name "gda_sql_select_from_new")
+  (is-constructor-of "GdaSqlSelectFrom")
+  (return-type "GdaSqlSelectFrom*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlSelectFrom")
+  (c-name "gda_sql_select_from_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlSelectFrom")
+  (c-name "gda_sql_select_from_copy")
+  (return-type "GdaSqlSelectFrom*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlSelectFrom")
+  (c-name "gda_sql_select_from_serialize")
+  (return-type "gchar*")
+)
+
+(define-method take_new_target
+  (of-object "GdaSqlSelectFrom")
+  (c-name "gda_sql_select_from_take_new_target")
+  (return-type "none")
+  (parameters
+    '("GdaSqlSelectTarget*" "target")
+  )
+)
+
+(define-method take_new_join
+  (of-object "GdaSqlSelectFrom")
+  (c-name "gda_sql_select_from_take_new_join")
+  (return-type "none")
+  (parameters
+    '("GdaSqlSelectJoin*" "join")
+  )
+)
+
+(define-function gda_sql_select_order_new
+  (c-name "gda_sql_select_order_new")
+  (is-constructor-of "GdaSqlSelectOrder")
+  (return-type "GdaSqlSelectOrder*")
+  (parameters
+    '("GdaSqlAnyPart*" "parent")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlSelectOrder")
+  (c-name "gda_sql_select_order_free")
+  (return-type "none")
+)
+
+(define-method copy
+  (of-object "GdaSqlSelectOrder")
+  (c-name "gda_sql_select_order_copy")
+  (return-type "GdaSqlSelectOrder*")
+)
+
+(define-method serialize
+  (of-object "GdaSqlSelectOrder")
+  (c-name "gda_sql_select_order_serialize")
+  (return-type "gchar*")
+)
+
+
+
+;; From gda-statement-struct-pspec.h
+
+(define-function gda_sql_param_spec_new
+  (c-name "gda_sql_param_spec_new")
+  (is-constructor-of "GdaSqlParamSpec")
+  (return-type "GdaSqlParamSpec*")
+  (parameters
+    '("GValue*" "simple_spec")
+  )
+)
+
+(define-method copy
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_copy")
+  (return-type "GdaSqlParamSpec*")
+)
+
+(define-method take_name
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_take_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_type
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_take_type")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_descr
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_take_descr")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method take_nullok
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_take_nullok")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method free
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_free")
+  (return-type "none")
+)
+
+(define-method serialize
+  (of-object "GdaSqlParamSpec")
+  (c-name "gda_sql_param_spec_serialize")
+  (return-type "gchar*")
+)
+
+
+
+;; From gda-statement-struct-select.h
+
+(define-method select_take_distinct
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_distinct")
+  (return-type "none")
+  (parameters
+    '("gboolean" "distinct")
+    '("GdaSqlExpr*" "distinct_expr")
+  )
+)
+
+(define-method select_take_expr_list
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_expr_list")
+  (return-type "none")
+  (parameters
+    '("GSList*" "expr_list")
+  )
+)
+
+(define-method select_take_from
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_from")
+  (return-type "none")
+  (parameters
+    '("GdaSqlSelectFrom*" "from")
+  )
+)
+
+(define-method select_take_where_cond
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_where_cond")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "expr")
+  )
+)
+
+(define-method select_take_group_by
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_group_by")
+  (return-type "none")
+  (parameters
+    '("GSList*" "group_by")
+  )
+)
+
+(define-method select_take_having_cond
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_having_cond")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "expr")
+  )
+)
+
+(define-method select_take_order_by
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_order_by")
+  (return-type "none")
+  (parameters
+    '("GSList*" "order_by")
+  )
+)
+
+(define-method select_take_limits
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_select_take_limits")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "count")
+    '("GdaSqlExpr*" "offset")
+  )
+)
+
+
+
+;; From gda-statement-struct-trans.h
+
+(define-method trans_take_mode
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_trans_take_mode")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method trans_set_isol_level
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_trans_set_isol_level")
+  (return-type "none")
+  (parameters
+    '("GdaTransactionIsolation" "level")
+  )
+)
+
+(define-method trans_take_name
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_trans_take_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+
+
+;; From gda-statement-struct-unknown.h
+
+(define-method unknown_take_expressions
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_unknown_take_expressions")
+  (return-type "none")
+  (parameters
+    '("GSList*" "expressions")
+  )
+)
+
+
+
+;; From gda-statement-struct-update.h
+
+(define-method update_take_table_name
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_update_take_table_name")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method update_take_on_conflict
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_update_take_on_conflict")
+  (return-type "none")
+  (parameters
+    '("GValue*" "value")
+  )
+)
+
+(define-method update_take_condition
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_update_take_condition")
+  (return-type "none")
+  (parameters
+    '("GdaSqlExpr*" "cond")
+  )
+)
+
+(define-method update_take_set_value
+  (of-object "GdaSqlStatement")
+  (c-name "gda_sql_statement_update_take_set_value")
+  (return-type "none")
+  (parameters
+    '("GValue*" "fname")
+    '("GdaSqlExpr*" "expr")
+  )
+)
+
+
+
+;; From gda-statement-struct-util.h
+
+(define-function gda_sql_identifier_needs_quotes
+  (c-name "gda_sql_identifier_needs_quotes")
+  (return-type "gboolean")
+  (parameters
+    '("const-gchar*" "str")
+  )
+)
+
+(define-function gda_sql_identifier_add_quotes
+  (c-name "gda_sql_identifier_add_quotes")
+  (return-type "gchar*")
+  (parameters
+    '("const-gchar*" "str")
+  )
+)
+
+(define-function gda_sql_identifier_remove_quotes
+  (c-name "gda_sql_identifier_remove_quotes")
+  (return-type "gchar*")
+  (parameters
+    '("gchar*" "str")
+  )
+)
+
+(define-function gda_sql_value_stringify
+  (c-name "gda_sql_value_stringify")
+  (return-type "gchar*")
+  (parameters
+    '("const-GValue*" "value")
+  )
+)
+
+
diff --git a/libgda/src/sqlbuilder.hg b/libgda/src/sqlbuilder.hg
index ab28ac5..068a4ad 100644
--- a/libgda/src/sqlbuilder.hg
+++ b/libgda/src/sqlbuilder.hg
@@ -20,6 +20,7 @@
  */
 
 #include <libgdamm/statement.h>
+#include <libgdamm/sqlexpr.h>
 
 _DEFS(libgdamm,libgda)
 _PINCLUDE(glibmm/private/object_p.h)
@@ -151,7 +152,7 @@ public:
     */
   guint add_function(const Glib::ustring& function_name, guint arg);
 
-  _WRAP_METHOD(void 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(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
   /** Adds a new target to a SELECT statement
@@ -217,6 +218,8 @@ public:
   //TODO: Wrap the enum when we wrap GdaSqlStatementCompound _WRAP_METHOD(void compound_set_type(SqlStatementCompoundType compound_type), gda_sql_builder_compound_set_type)
   //The steal parameter suggests that this is an internal function: _WRAP_METHOD(void compound_add_sub_select(const Glib::RefPtr<SqlStatement>& sqlst, bool steal), gda_sql_builder_compound_add_sub_select)
 
+  _WRAP_METHOD(SqlExpr export_expression(guint id), gda_sql_builder_export_expression)
+  _WRAP_METHOD(guint import_expressio(guint id, const SqlExpr& expr), gda_sql_builder_import_expression )
 };
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
diff --git a/libgda/src/sqlexpr.ccg b/libgda/src/sqlexpr.ccg
new file mode 100644
index 0000000..060a7dc
--- /dev/null
+++ b/libgda/src/sqlexpr.ccg
@@ -0,0 +1,38 @@
+// -*- C++ -*- //
+
+/* quarklist.ccg
+ *
+ * Copyright 2001      Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <libgda/sql-parser/gda-statement-struct-parts.h>
+
+
+namespace Gnome
+{
+
+namespace Gda
+{
+
+SqlExpr::SqlExpr(GdaSqlAnyPart *parent)
+: gobject_(gda_sql_expr_new(parent))
+{
+}
+
+} // namespace Gda
+
+} // namesoace Gnome
diff --git a/libgda/src/sqlexpr.hg b/libgda/src/sqlexpr.hg
new file mode 100644
index 0000000..550cc64
--- /dev/null
+++ b/libgda/src/sqlexpr.hg
@@ -0,0 +1,52 @@
+// -*- C++ -*- //
+
+/* quarklist.h
+ *
+ * Copyright 2001      Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+_DEFS(libgdamm,libgda)
+
+#include <libgda/sql-parser/gda-statement-struct-parts.h>
+
+namespace Gnome
+{
+
+namespace Gda
+{
+
+/** TODO
+ */
+class SqlExpr
+{
+  _CLASS_BOXEDTYPE(SqlExpr, GdaSqlExpr, NONE, gda_sql_expr_copy, gda_sql_expr_free)
+  _IGNORE(gda_sql_expr_get_type, gda_sql_expr_copy, gda_sql_expr_free)
+
+public:
+  //TODO: Wrap GdaSqlAnyPart.
+  explicit SqlExpr(GdaSqlAnyPart *parent);
+  _IGNORE(gda_sql_expr_new)
+
+  _WRAP_METHOD(Glib::ustring serialize() const, gda_sql_expr_serialize)
+
+  //TODO: _WRAP_METHOD(void take_select(GdaSqlStatement *stmt), gda_sql_expr_take_select)
+
+};
+
+} // namespace Gda
+
+} // namespace Gnome
diff --git a/tools/m4/convert_libgdamm.m4 b/tools/m4/convert_libgdamm.m4
index 42ee37e..0c176b1 100644
--- a/tools/m4/convert_libgdamm.m4
+++ b/tools/m4/convert_libgdamm.m4
@@ -153,3 +153,5 @@ _CONVERSION(`GValue*', `Value', `$2($3)')
 _CONVERSION(`const GValue*', `Value', `$2($3)')
 
 
+_CONVERSION(`const SqlExpr&', `GdaSqlExpr*', `const_cast<GdaSqlExpr*>(($3).gobj())')
+_CONVERSION(`GdaSqlExpr*', `SqlExpr', `Glib::wrap($3)')



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