<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.2008666082">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.2008666082" moduleId="org.eclipse.cdt.core.settings" name="Default">
+ <cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
<externalSettings/>
<extensions>
+ <extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
- <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration artifactName="libgdaex" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.mingw.base.2008666082" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="cdt.managedbuild.toolchain.gnu.mingw.base.2008666082.1629362093" name="/" resourcePath="">
- <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.base.239345556" name="cdt.managedbuild.toolchain.gnu.mingw.base" superClass="cdt.managedbuild.toolchain.gnu.mingw.base">
- <targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.PE" id="cdt.managedbuild.target.gnu.platform.mingw.base.1811874117" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.mingw.base"/>
- <builder buildPath="${workspace_loc:/libgdaex/Default}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.437642443" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.base.249395220" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.base">
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1469065797" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ <configuration artifactName="libgdaex" buildProperties="" description="" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220" name="Build (GNU)" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220.1140774633" name="/" resourcePath="">
+ <toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1169085170" name="org.eclipse.linuxtools.cdt.autotools.core.toolChain" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolChain">
+ <targetPlatform id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform.1574431706" isAbstract="false" name="GNU Autotools Target Platform" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.targetPlatform"/>
+ <builder id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder.1882917889" keepEnvironmentInBuildfile="false" managedBuildOn="false" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.builder"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure.2068581653" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
+ <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1289756841" name="Name" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220" valueType="string"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.521466955" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.1978833679" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base"/>
- <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.base.1090629218" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.base">
- <option id="gnu.c.compiler.option.include.paths.420212102" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.1777506173" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.922691597" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
+ <option id="gnu.c.compiler.option.include.paths.1903985397" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""C:\mingw\include""/>
- <listOptionValue builtIn="false" value=""C:\mingw\include\libxml2""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\glib-2.0""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\gtk-2.0""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\libgda-4.0""/>
</option>
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1969516801" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1486987507" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
- <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1141104592" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base">
- <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1565299810" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
- <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
- <additionalInput kind="additionalinput" paths="$(LIBS)"/>
- </inputType>
- </tool>
- <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base.1409110738" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.base"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.1116753970" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp"/>
</toolChain>
</folderInfo>
</configuration>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="libgdaex.null.618719898" name="libgdaex"/>
+ <project id="libgdaex.null.983135216" name="libgdaex"/>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="refreshScope" versionNumber="2">
+ <configuration configurationName="Build (GNU)">
+ <resource resourceType="PROJECT" workspacePath="/libgdaex"/>
+ </configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </storageModule>
- <storageModule moduleId="refreshScope" versionNumber="1">
- <resource resourceType="PROJECT" workspacePath="/libgdaex"/>
+ <scannerConfigBuildInfo instanceId="org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220;org.eclipse.linuxtools.cdt.autotools.core.toolChain.302737220.1140774633;org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.922691597;cdt.managedbuild.tool.gnu.c.compiler.input.1486987507">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
</storageModule>
</cproject>
*.o
*.la
*.bak
+intltool*
libgdaex*tar*
tests/test_prefix*
tests/query_editor
tests/fill_liststore
tests/*.exe
tests/select
+tests/getsql
</natures>
<filteredResources>
<filter>
- <id>1322811819863</id>
+ <id>1372229253590</id>
<name></name>
<type>30</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819866</id>
+ <id>1372229253595</id>
<name></name>
<type>30</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819870</id>
- <name></name>
- <type>22</type>
- <matcher>
- <id>org.eclipse.ui.ide.multiFilter</id>
- <arguments>1.0-name-matches-false-false-config.h</arguments>
- </matcher>
- </filter>
- <filter>
- <id>1322811819875</id>
+ <id>1372229253598</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819878</id>
+ <id>1372229253604</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819881</id>
+ <id>1372229253608</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819885</id>
+ <id>1372229253611</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819888</id>
+ <id>1372229253620</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819891</id>
+ <id>1372229253623</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819895</id>
+ <id>1372229253627</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819898</id>
+ <id>1372229253631</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819902</id>
+ <id>1372229253634</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819905</id>
+ <id>1372229253637</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819908</id>
+ <id>1372229253640</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819912</id>
+ <id>1372229253643</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819915</id>
+ <id>1372229253646</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819918</id>
+ <id>1372229253650</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819921</id>
+ <id>1372229253653</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819924</id>
+ <id>1372229253656</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819928</id>
+ <id>1372229253660</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819931</id>
+ <id>1372229253663</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819934</id>
+ <id>1372229253668</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819938</id>
+ <id>1372229253671</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811819942</id>
+ <id>1372229253674</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811820098</id>
+ <id>1372229253677</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811820101</id>
+ <id>1372229253682</id>
<name></name>
<type>22</type>
<matcher>
</matcher>
</filter>
<filter>
- <id>1322811820117</id>
+ <id>1372229253686</id>
<name></name>
<type>22</type>
<matcher>
<arguments>1.0-name-matches-false-false-*.lo</arguments>
</matcher>
</filter>
+ <filter>
+ <id>1372229253690</id>
+ <name></name>
+ <type>22</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.dll</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1372229253694</id>
+ <name></name>
+ <type>22</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.a</arguments>
+ </matcher>
+ </filter>
</filteredResources>
</projectDescription>
#include <gio/gio.h>
#include <libgda/sql-parser/gda-sql-parser.h>
+#include <libgda/sql-parser/gda-sql-statement.h>
#include "gdaex.h"
gdaex_data_model_is_empty (GdaDataModel *data_model)
{
return (!GDA_IS_DATA_MODEL (data_model)
- || gda_data_model_get_n_rows (data_model) == 0);
+ || gda_data_model_get_n_rows (data_model) < 1);
}
/**
gchar *ret;
const GValue *v;
+ ret = NULL;
+
v = gda_data_model_iter_get_value_at (iter, col);
if (v == NULL)
{
gdaex_fill_liststore_from_datamodel_with_missing_func (gdaex, lstore, dm, cols_formatted, cols_format_func, NULL, NULL);
}
+const gchar
+*gdaex_get_sql_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;
+
+ gpointer key_fields;
+ gpointer value_fields;
+ gpointer key_keys;
+ gpointer value_keys;
+
+ GdaSqlBuilderId id_field;
+ GdaSqlBuilderId id_value;
+ GdaSqlBuilderId id_cond;
+
+ g_return_val_if_fail (IS_GDAEX (gdaex), "");
+ g_return_val_if_fail (table_name != NULL, "");
+
+ _table_name = g_strstrip (g_strdup (table_name));
+ g_return_val_if_fail (g_strcmp0 (table_name, "") != 0, "");
+
+ priv = GDAEX_GET_PRIVATE (gdaex);
+
+ b = NULL;
+
+ ret = "";
+
+ switch (sqltype)
+ {
+ case GDAEX_SQL_SELECT:
+ b = gda_sql_builder_new (GDA_SQL_STATEMENT_SELECT);
+
+ gda_sql_builder_select_add_target_id (b,
+ gda_sql_builder_add_id (b, _table_name),
+ NULL);
+
+ if (fields == NULL || g_hash_table_size (fields) < 0)
+ {
+ gda_sql_builder_select_add_field (b, "*", NULL, NULL);
+ }
+ else
+ {
+ g_hash_table_iter_init (&ht_iter_fields, fields);
+ while (g_hash_table_iter_next (&ht_iter_fields, &key_fields, &value_fields))
+ {
+ gda_sql_builder_select_add_field (b, (const gchar *)key_fields, NULL, NULL);
+ }
+ }
+ break;
+
+ case GDAEX_SQL_INSERT:
+ b = gda_sql_builder_new (GDA_SQL_STATEMENT_INSERT);
+ gda_sql_builder_set_table (b, _table_name);
+
+ if (fields != NULL && g_hash_table_size (fields) > 0)
+ {
+ g_hash_table_iter_init (&ht_iter_fields, fields);
+ while (g_hash_table_iter_next (&ht_iter_fields, &key_fields, &value_fields))
+ {
+ gda_sql_builder_add_field_value_as_gvalue (b, (const gchar *)key_fields, (const GValue *)value_fields);
+ }
+ }
+ break;
+
+ case GDAEX_SQL_UPDATE:
+ b = gda_sql_builder_new (GDA_SQL_STATEMENT_UPDATE);
+ gda_sql_builder_set_table (b, _table_name);
+
+ if (fields == NULL || g_hash_table_size (fields) < 0)
+ {
+ g_warning (_("HashTable fields cannot be empty."));
+ }
+ else
+ {
+ g_hash_table_iter_init (&ht_iter_fields, fields);
+ while (g_hash_table_iter_next (&ht_iter_fields, &key_fields, &value_fields))
+ {
+ gda_sql_builder_add_field_value_as_gvalue (b, (const gchar *)key_fields, (const GValue *)value_fields);
+ }
+
+ g_hash_table_iter_init (&ht_iter_keys, keys);
+ while (g_hash_table_iter_next (&ht_iter_keys, &key_keys, &value_keys))
+ {
+ id_field = gda_sql_builder_add_id (b, (const gchar *)key_keys);
+ id_value = gda_sql_builder_add_expr_value (b, NULL, (const GValue *)value_keys);
+ id_cond = gda_sql_builder_add_cond (b, GDA_SQL_OPERATOR_TYPE_EQ, id_field, id_value, 0);
+ gda_sql_builder_set_where (b, id_cond);
+ }
+ }
+ break;
+
+ case GDAEX_SQL_DELETE:
+ b = gda_sql_builder_new (GDA_SQL_STATEMENT_DELETE);
+ gda_sql_builder_set_table (b, _table_name);
+
+ if (keys != NULL && g_hash_table_size (fields) > 0)
+ {
+ g_hash_table_iter_init (&ht_iter_keys, keys);
+ while (g_hash_table_iter_next (&ht_iter_keys, &key_keys, &value_keys))
+ {
+ id_field = gda_sql_builder_add_id (b, (const gchar *)key_keys);
+ id_value = gda_sql_builder_add_expr_value (b, NULL, (const GValue *)value_keys);
+ id_cond = gda_sql_builder_add_cond (b, GDA_SQL_OPERATOR_TYPE_EQ, id_field, id_value, 0);
+ gda_sql_builder_set_where (b, id_cond);
+ }
+ }
+ break;
+ }
+
+ error = NULL;
+ stmt = gda_sql_builder_get_statement (b, &error);
+ if (error != NULL || stmt == NULL)
+ {
+ g_warning (_("Unable to get a GdaStatement from GdaSqlBuilder: %s"),
+ error->message != NULL ? error->message : _("no details"));
+ }
+
+ error = NULL;
+ ret = gda_statement_to_sql_extended (stmt,
+ priv->gda_conn,
+ NULL,
+ 0,
+ NULL,
+ &error);
+ if (error != NULL)
+ {
+ g_warning (_("Unable to get an SQL statement from GdaStatement: %s"),
+ error->message != NULL ? error->message : _("no details"));
+ }
+
+ if (b != NULL)
+ {
+ g_object_unref (b);
+ }
+
+ g_free (_table_name);
+
+ return ret;
+}
+
gchar
*gdaex_format_money (gdouble number,
gint decimals,
guint *cols_formatted,
gchar *(*cols_format_func) (GdaDataModelIter *, guint));
+typedef enum
+{
+ GDAEX_SQL_SELECT,
+ GDAEX_SQL_INSERT,
+ GDAEX_SQL_UPDATE,
+ GDAEX_SQL_DELETE
+} GdaExSqlType;
+
+const gchar *gdaex_get_sql_from_hashtable (GdaEx *gdaex,
+ GdaExSqlType sqltype,
+ const gchar *table_name,
+ GHashTable *keys,
+ GHashTable *fields);
+
gchar *gdaex_format_money (gdouble number,
gint decimals,
gboolean with_currency_symbol);
-DTESTSDIR="\"@abs_builddir@\""
noinst_PROGRAMS = fill_liststore \
+ getsql \
grid \
query_editor \
select \
--- /dev/null
+/*
+ * Copyright (C) 2013 Andrea Zagli <azagli@libero.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <gtk/gtk.h>
+#include <libgdaex.h>
+
+int
+main (int argc, char **argv)
+{
+ GdaEx *gdaex;
+
+ GHashTable *ht_keys;
+ GHashTable *ht_fields;
+
+ GValue *gval;
+ GDate *gdate;
+
+ gtk_init (&argc, &argv);
+
+ gdaex = gdaex_new_from_string (g_strdup_printf ("SQLite://DB_DIR=%s;DB_NAME=grid.db", TESTSDIR));
+ if (gdaex == NULL)
+ {
+ g_error ("Unable to connect to the db.");
+ }
+
+ ht_keys = g_hash_table_new (g_str_hash, g_str_equal);
+ ht_fields = g_hash_table_new (g_str_hash, g_str_equal);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "id");
+ g_hash_table_insert (ht_fields, "id", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "name");
+ g_hash_table_insert (ht_fields, "name", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "surname");
+ g_hash_table_insert (ht_fields, "surname", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "birthday");
+ g_hash_table_insert (ht_fields, "birthday", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "address");
+ g_hash_table_insert (ht_fields, "address", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "incoming");
+ g_hash_table_insert (ht_fields, "incoming", gval);
+
+ g_message ("%s", gdaex_get_sql_from_hashtable (gdaex, GDAEX_SQL_SELECT, "clients", ht_keys, ht_fields));
+ g_hash_table_destroy (ht_keys);
+ g_hash_table_destroy (ht_fields);
+
+ g_message ("%s", gdaex_get_sql_from_hashtable (gdaex, GDAEX_SQL_INSERT, "clients", ht_keys, ht_fields));
+
+ ht_keys = g_hash_table_new (g_str_hash, g_str_equal);
+ ht_fields = g_hash_table_new (g_str_hash, g_str_equal);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_INT);
+ g_value_set_int (gval, 44);
+ g_hash_table_insert (ht_fields, "id", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "my name is my name");
+ g_hash_table_insert (ht_fields, "name", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "and this is the sur'name with '");
+ g_hash_table_insert (ht_fields, "surname", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_DATE);
+ gdate = g_date_new_dmy (12, 5, 1966);
+ g_value_set_boxed (gval, gdate);
+ g_hash_table_insert (ht_fields, "birthday", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "5th avenue, 44");
+ g_hash_table_insert (ht_fields, "address", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_DOUBLE);
+ g_value_set_double (gval, 1451.22);
+ g_hash_table_insert (ht_fields, "incoming", gval);
+
+ g_message ("%s", gdaex_get_sql_from_hashtable (gdaex, GDAEX_SQL_INSERT, "clients", ht_keys, ht_fields));
+ g_hash_table_destroy (ht_keys);
+ g_hash_table_destroy (ht_fields);
+
+ ht_keys = g_hash_table_new (g_str_hash, g_str_equal);
+ ht_fields = g_hash_table_new (g_str_hash, g_str_equal);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "my new name");
+ g_hash_table_insert (ht_fields, "name", gval);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_STRING);
+ g_value_set_string (gval, "and this is the new sur'name with '");
+ g_hash_table_insert (ht_fields, "surname", gval);
+
+ ht_keys = g_hash_table_new (g_str_hash, g_str_equal);
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_INT);
+ g_value_set_int (gval, 55);
+ g_hash_table_insert (ht_keys, "id", gval);
+
+ g_message ("%s", gdaex_get_sql_from_hashtable (gdaex, GDAEX_SQL_UPDATE, "clients", ht_keys, ht_fields));
+ g_hash_table_destroy (ht_keys);
+ g_hash_table_destroy (ht_fields);
+
+ ht_keys = g_hash_table_new (g_str_hash, g_str_equal);
+
+ gval = g_new0 (GValue, 1);
+ g_value_init (gval, G_TYPE_INT);
+ g_value_set_int (gval, 55);
+ g_hash_table_insert (ht_keys, "id", gval);
+
+ g_message ("%s", gdaex_get_sql_from_hashtable (gdaex, GDAEX_SQL_DELETE, "clients", ht_keys, ht_fields));
+ g_hash_table_destroy (ht_keys);
+
+ return 0;
+}