]> saetta.ns0.it Git - libgdaex/commitdiff
Added functions GdaEx::data_model_columns_to_hashtable_from_sql
authorAndrea Zagli <azagli@libero.it>
Sun, 25 Dec 2011 09:29:45 +0000 (10:29 +0100)
committerAndrea Zagli <azagli@libero.it>
Sun, 25 Dec 2011 09:29:45 +0000 (10:29 +0100)
and GdaEx::data_model_row_to_hashtable_from_sql (closes #278)."

.anjuta/session/anjuta.session
.anjuta/session/dock-layout.xml
.anjuta_sym_db.db
src/gdaex.c
src/gdaex.h

index 1282bd7e2c779613477b0817d75a012abbb3db08..08753d500e015da78c6807cbf62a96f6ccd3fbb3 100644 (file)
@@ -8,7 +8,7 @@ Shortcut=libgdaex//libgdaex//src//libgdaex.la%%%libgdaex//libgdaex//tests//fill_
 Expand=libgdaex.la%%%libgdaex
 
 [File Loader]
-Files=file:///home/andreaz/files/c/libgdaex/src/queryeditor.c#1710
+Files=file:///home/andreaz/files/c/libgdaex/src/queryeditor.c#1259
 
 [Document Manager]
 bookmarks=<?xml version="1.0" encoding="UTF-8"?>\n<bookmarks/>\n
index c70c788925ab45542730f93d1de557b4544a6db1..e55f84aa834d988f4be58c273ada0a968a0aacd8 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version="1.0"?>
-<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="1019"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaDevhelpDisplay" orientation="vertical" locked="yes"/><item name="AnjutaTerminal" orientation="vertical" locked="yes"/></notebook><paned orientation="vertical" locked="no" position="289"><notebook orientation="vertical" locked="no" page="1"><item name="AnjutaFileManager" orientation="vertical" locked="no"/><item name="AnjutaProjectManager" orientation="vertical" locked="no"/></notebook><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaSymbolDB" orientation="vertical" locked="no"/><item name="AnjutaDevhelpIndex" orientation="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
+<dock-layout><layout name="__default__"><dock name="__dock_1" floating="no" width="-1" height="-1" floatx="0" floaty="0"><paned orientation="horizontal" locked="no" position="1019"><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaDocumentManager" orientation="vertical" locked="no"/><item name="AnjutaDevhelpDisplay" orientation="vertical" locked="yes"/><item name="AnjutaTerminal" orientation="vertical" locked="yes"/></notebook><paned orientation="vertical" locked="no" position="286"><notebook orientation="vertical" locked="no" page="1"><item name="AnjutaFileManager" orientation="vertical" locked="no"/><item name="AnjutaProjectManager" orientation="vertical" locked="no"/></notebook><notebook orientation="vertical" locked="no" page="0"><item name="AnjutaSymbolDB" orientation="vertical" locked="no"/><item name="AnjutaDevhelpIndex" orientation="vertical" locked="no"/></notebook></paned></paned></dock></layout></dock-layout>
index b8cbbc5185e421d170b25f77ff19b2fbe861c866..fe2c1265fb2423370be0a59b34ab8820554b58ac 100644 (file)
Binary files a/.anjuta_sym_db.db and b/.anjuta_sym_db.db differ
index b7ee9d0d9ffc4a71d6b3c8666c5259ab7997e078..a977d2180e4a87dc0e3b2d836eded5a3fc2e2704 100644 (file)
@@ -2318,6 +2318,52 @@ GHashTable
        return ret;
 }
 
+/**
+ * gdaex_data_model_columns_to_hashtable_from_sql:
+ * @gdaex: a #GdaEx object.
+ * @sql: an SQL statement.
+ *
+ * Returns: a #GHashTable with keys as the columns names from @sql,
+ * and values as columns numbers.
+ */
+GHashTable
+*gdaex_data_model_columns_to_hashtable_from_sql (GdaEx *gdaex, gchar *sql)
+{
+       GHashTable *ret;
+       GdaDataModel *dm;
+
+       g_return_val_if_fail (IS_GDAEX (gdaex), NULL);
+
+       dm = gdaex_query (gdaex, sql);
+       ret = gdaex_data_model_columns_to_hashtable (dm);
+
+       return ret;
+}
+
+/**
+ * gdaex_data_modelrow_to_hashtable_from_sql:
+ * @gdaex: a #GdaEx object.
+ * @sql: an SQL statement.
+ * @row: row number.
+ *
+ * Returns: a #GHashTable with keys as the columns names from @sql,
+ * and values as #GValue.
+ */
+GHashTable
+*gdaex_data_model_row_to_hashtable_from_sql (GdaEx *gdaex, gchar *sql, guint row)
+{
+       GHashTable *ret;
+       GdaDataModel *dm;
+
+       g_return_val_if_fail (IS_GDAEX (gdaex), NULL);
+       g_return_val_if_fail (sql != NULL, NULL);
+
+       dm = gdaex_query (gdaex, sql);
+       ret = gdaex_data_model_row_to_hashtable (dm, row);
+
+       return ret;
+}
+
 /**
  * gdaex_data_model_to_gtkliststore:
  * @dm: a #GdaDataModel object.
index 8740a05f133981ce76e9f4b454a830d2dc632278..d2bd54b20b646851ae254bdc700f73cb716500fc 100644 (file)
@@ -178,6 +178,9 @@ struct tm *gdaex_data_model_iter_get_value_tm_at (GdaDataModelIter *iter,
 GHashTable *gdaex_data_model_columns_to_hashtable (GdaDataModel *dm);
 GHashTable *gdaex_data_model_row_to_hashtable (GdaDataModel *dm, guint row);
 
+GHashTable *gdaex_data_model_columns_to_hashtable_from_sql (GdaEx *gdaex, gchar *sql);
+GHashTable *gdaex_data_model_row_to_hashtable_from_sql (GdaEx *gdaex, gchar *sql, guint row);
+
 GtkListStore *gdaex_data_model_to_gtkliststore (GdaDataModel *dm,
                                                 gboolean only_schema);