]> saetta.ns0.it Git - libgdaex/commitdiff
SqlBuilder: added GdaConnection and params to ::get_sql.
authorAndrea Zagli <azagli@libero.it>
Sat, 11 Jul 2015 15:39:07 +0000 (17:39 +0200)
committerAndrea Zagli <azagli@libero.it>
Sat, 11 Jul 2015 15:39:07 +0000 (17:39 +0200)
.gitignore
src/sqlbuilder.c
src/sqlbuilder.h
tests/sqlbuilder.c

index e610f13237b5dc699695ba8d20b02ef32a0da65a..c54157ba6aafa819d2787d11eab2d7b1aa991bfb 100644 (file)
@@ -48,3 +48,4 @@ tests/fill_liststore
 tests/*.exe
 tests/select
 tests/getsql
+tests/sqlbuilder
index 24a3a7088932963fc48cae84db7d401bb1df6147..d693d3bca17f795ab73daeba94468d2174a5d54a 100644 (file)
@@ -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;
index 0ab758940bdf4a81fcafdcf15b0389eaa165e085..6aed4a866b0ba65b476a9bd51e2069c75ce4f3d7 100644 (file)
@@ -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
index 63dcd26532d1385895cf302a1a3918e527ea9b78..efbe94e3ee2e04cc33c71328ea9ceb363082ae8a 100644 (file)
@@ -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;
 }