gdaex_fill_liststore_from_datamodel_with_missing_func (gdaex, lstore, dm, cols_formatted, format_func, NULL, NULL);
}
-const gchar
-*gdaex_get_sql_from_hashtable (GdaEx *gdaex,
- GdaExSqlType sqltype,
- const gchar *table_name,
- GHashTable *keys,
- GHashTable *fields)
+GdaSqlBuilder
+*gdaex_get_gda_sqlbuilder_from_hashtable (GdaEx *gdaex,
+ GdaExSqlType sqltype,
+ const gchar *table_name,
+ GHashTable *keys,
+ GHashTable *fields)
{
- gchar *ret;
gchar *_table_name;
- GError *error;
GdaSqlBuilder *b;
- GdaStatement *stmt;
-
- GdaExPrivate *priv;
GHashTableIter ht_iter_fields;
GHashTableIter ht_iter_keys;
GdaSqlBuilderId id_value;
GdaSqlBuilderId id_cond;
- g_return_val_if_fail (IS_GDAEX (gdaex), "");
- g_return_val_if_fail (table_name != NULL, "");
+ g_return_val_if_fail (IS_GDAEX (gdaex), NULL);
+ g_return_val_if_fail (table_name != NULL, NULL);
_table_name = g_strstrip (g_strdup (table_name));
- g_return_val_if_fail (g_strcmp0 (table_name, "") != 0, "");
-
- priv = GDAEX_GET_PRIVATE (gdaex);
+ g_return_val_if_fail (g_strcmp0 (table_name, "") != 0, NULL);
b = NULL;
- ret = "";
-
switch (sqltype)
{
case GDAEX_SQL_SELECT:
break;
}
+ g_free (_table_name);
+
+ return b;
+}
+
+const gchar
+*gdaex_get_sql_from_hashtable (GdaEx *gdaex,
+ GdaExSqlType sqltype,
+ const gchar *table_name,
+ GHashTable *keys,
+ GHashTable *fields)
+{
+ GError *error;
+
+ GdaSqlBuilder *b;
+ GdaStatement *stmt;
+
+ GdaExPrivate *priv;
+
+ gchar *ret;
+
+ priv = GDAEX_GET_PRIVATE (gdaex);
+
+ b = gdaex_get_gda_sqlbuilder_from_hashtable (gdaex,
+ sqltype,
+ table_name,
+ keys,
+ fields);
+
+ if (b == NULL)
+ {
+ return NULL;
+ }
+
error = NULL;
stmt = gda_sql_builder_get_statement (b, &error);
if (stmt == NULL || error != NULL)
g_object_unref (b);
}
- g_free (_table_name);
-
return ret;
}