From: Andrea Zagli Date: Sat, 24 Nov 2012 15:32:02 +0000 (+0100) Subject: Added rows counter during copying data. X-Git-Tag: 0.0.1~9 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=565bc971014896bd7217e357cdfabc49e4c73125;p=gdadbcopy Added rows counter during copying data. --- diff --git a/.anjuta_sym_db.db b/.anjuta_sym_db.db index 3dcb362..f0289eb 100644 Binary files a/.anjuta_sym_db.db and b/.anjuta_sym_db.db differ diff --git a/src/main.c b/src/main.c index 22284eb..aea1712 100644 --- a/src/main.c +++ b/src/main.c @@ -80,14 +80,19 @@ copy_data () GSList *lst_tables; GSList *lst_fields; + GError *error; + gchar *sql; GdaDataModel *dm; - const GValue *gval; - GError *error; + guint row; + guint rows; - GdaStatement *stmt; GdaDataModelIter *iter; + + GdaStatement *stmt; + + const GValue *gval; GdaMetaTableColumn *column; GdaSet *params; GdaHolder *holder; @@ -105,7 +110,7 @@ copy_data () g_free (sql); if (dm != NULL) { - g_printf ("\tTable: %s\n", + g_printf ("\tTable: %s", table->name); iter = gda_data_model_create_iter (dm); @@ -120,8 +125,16 @@ copy_data () error = NULL; gda_statement_get_parameters (stmt, ¶ms, &error); + row = 0; + rows = gda_data_model_get_n_rows (dm); + while (gda_data_model_iter_move_next (iter)) { + g_printf ("\r\tTable: %s - %d of %d", + table->name, + ++row, + rows); + for (lst_fields = table->fields; lst_fields; lst_fields = lst_fields->next) { column = (GdaMetaTableColumn *)lst_fields->data; @@ -159,6 +172,7 @@ copy_data () continue; } } + g_printf ("\n"); g_object_unref (params); g_object_unref (stmt); diff --git a/tests/db.db b/tests/db.db index 5cf743a..dc43486 100644 Binary files a/tests/db.db and b/tests/db.db differ