From: Andrea Zagli Date: Sat, 11 Jul 2015 15:39:07 +0000 (+0200) Subject: SqlBuilder: added GdaConnection and params to ::get_sql. X-Git-Tag: v0.6.0~9 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=386ba5bc4b6c56fa1b44ac173d71e407802ba8b1;p=libgdaex SqlBuilder: added GdaConnection and params to ::get_sql. --- diff --git a/.gitignore b/.gitignore index e610f13..c54157b 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ tests/fill_liststore tests/*.exe tests/select tests/getsql +tests/sqlbuilder diff --git a/src/sqlbuilder.c b/src/sqlbuilder.c index 24a3a70..d693d3b 100644 --- a/src/sqlbuilder.c +++ b/src/sqlbuilder.c @@ -344,7 +344,7 @@ GdaSqlBuilder } const gchar -*gdaex_sql_builder_get_sql (GdaExSqlBuilder *sqlb) +*gdaex_sql_builder_get_sql (GdaExSqlBuilder *sqlb, GdaConnection *cnc, GdaSet *params) { gchar *ret; GdaStatement *stmt; @@ -356,7 +356,12 @@ const gchar stmt = gda_sql_builder_get_statement (priv->sqlb, NULL); if (stmt != NULL) { - ret = gda_statement_to_sql (stmt, NULL, NULL); + ret = gda_statement_to_sql_extended (stmt, + cnc, + params, + GDA_STATEMENT_SQL_PARAMS_AS_VALUES, + NULL, + NULL); } return ret; diff --git a/src/sqlbuilder.h b/src/sqlbuilder.h index 0ab7589..6aed4a8 100644 --- a/src/sqlbuilder.h +++ b/src/sqlbuilder.h @@ -70,7 +70,7 @@ void gdaex_sql_builder_join (GdaExSqlBuilder *sqlb, void gdaex_sql_builder_fields (GdaExSqlBuilder *sqlb, ...); GdaSqlBuilder *gdaex_sql_builder_get_gda_sql_builder (GdaExSqlBuilder *sqlb); -const gchar *gdaex_sql_builder_get_sql (GdaExSqlBuilder *sqlb); +const gchar *gdaex_sql_builder_get_sql (GdaExSqlBuilder *sqlb, GdaConnection *cnc, GdaSet *params); G_END_DECLS diff --git a/tests/sqlbuilder.c b/tests/sqlbuilder.c index 63dcd26..efbe94e 100644 --- a/tests/sqlbuilder.c +++ b/tests/sqlbuilder.c @@ -43,7 +43,7 @@ main (int argc, char **argv) "topolino", "id_pippo", "", NULL); - g_message ("sql: %s", gdaex_sql_builder_get_sql (sqlb)); + g_message ("sql: %s", gdaex_sql_builder_get_sql (sqlb, NULL, NULL)); return 0; }