<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
- <cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
+ <cconfiguration id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906" moduleId="org.eclipse.cdt.core.settings" name="Build (GNU)">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <configuration buildProperties="" description="" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930" name="Build (GNU)" parent="org.eclipse.cdt.build.core.emptycfg">
- <folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930.1685407473" name="/" resourcePath="">
- <toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.836272450" 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.1031969505" 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.1197732403" 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.9367114" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
- <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.1131657011" name="Name" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930" valueType="string"/>
+ <configuration buildProperties="" description="" id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906" name="Build (GNU)" parent="org.eclipse.cdt.build.core.emptycfg">
+ <folderInfo id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906.224399110" name="/" resourcePath="">
+ <toolChain id="org.eclipse.linuxtools.cdt.autotools.core.toolChain.454212349" 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.1294595179" 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.1137626508" 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.366962293" name="configure" superClass="org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure">
+ <option id="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name.2134586507" superClass="org.eclipse.linuxtools.cdt.autotools.core.option.configure.name" value="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906" valueType="string"/>
</tool>
- <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.155784590" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
- <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.867105742" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
- <option id="gnu.c.compiler.option.include.paths.621876005" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen.726647795" name="autogen.sh" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.autogen"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.268465676" name="GCC C Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc">
+ <option id="gnu.c.compiler.option.include.paths.2002526018" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value=""C:\mingw\include""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\glib-2.0""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\libxml2""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\libgda-4.0""/>
<listOptionValue builtIn="false" value=""C:\mingw\include\libgda-4.0\libgda""/>
</option>
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.842059199" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1374899466" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
- <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.985338712" name="GCC C++ Compiler" superClass="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp"/>
+ <tool id="org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gpp.1477690685" 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="gdadbcopy.null.366714648" name="gdadbcopy"/>
+ <project id="gdadbcopy.null.1010149427" name="gdadbcopy"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906;org.eclipse.linuxtools.cdt.autotools.core.toolChain.1442100906.224399110;org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.268465676;cdt.managedbuild.tool.gnu.c.compiler.input.1374899466">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
+ </scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930;org.eclipse.linuxtools.cdt.autotools.core.toolChain.444330930.1685407473;org.eclipse.linuxtools.cdt.autotools.core.toolchain.tool.gcc.867105742;cdt.managedbuild.tool.gnu.c.compiler.input.842059199">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
return TRUE;
}
+static void
+read_fields_explicit (Table *table, GdaServerOperation *op, GdaDataModel *dm)
+{
+ guint col;
+ guint cols;
+
+ GdaColumn *gda_column;
+ GdaMetaTableColumn *mt_column;
+
+ cols = gda_data_model_get_n_columns (dm);
+ for (col = 0; col < cols; col++)
+ {
+ gda_column = gda_data_model_describe_column (dm, col);
+
+ mt_column = g_new0 (GdaMetaTableColumn, 1);
+ mt_column->column_name = g_strdup (gda_column_get_name (gda_column));
+ mt_column->column_type = g_strdup (gda_column_get_dbms_type (gda_column));
+ mt_column->gtype = gda_column_get_g_type (gda_column);
+ /*mt_column->pkey = gda_column_get_*/
+ mt_column->nullok = gda_column_get_allow_null (gda_column);
+ mt_column->default_value = gda_value_stringify (gda_column_get_default_value (gda_column));
+ table->fields = g_slist_append (table->fields, mt_column);
+
+ if (verbose)
+ {
+ g_printf ("\t\tField: %s - %s - %d - %d - %d - %s\n",
+ mt_column->column_name,
+ mt_column->column_type,
+ mt_column->gtype,
+ mt_column->pkey,
+ mt_column->nullok,
+ mt_column->default_value);
+ }
+
+ field_server_operation (table, op, mt_column, col);
+ }
+}
+
static void
read_fields (Table *table, GdaServerOperation *op)
{
table->fields = NULL;
+ if (meta_table->columns != NULL && meta_table->columns->data != NULL)
+ {
i = 0;
for (list = meta_table->columns; list; list = list->next, i++)
{
field_server_operation (table, op, column, i);
}
+ }
+ else
+ {
+ /* no columns; trying to read explicitly */
+ GdaSqlParser *parser;
+ gchar *sql;
+ GdaStatement *stmt;
+ GdaDataModel *dm;
+
+ g_printf ("* No columns from MetaStore: trying to read them from a select.\n");
+
+ parser = gda_connection_create_parser (gda_conn_ref_db);
+ if (!parser)
+ {
+ /* @cnc doe snot provide its own parser => use default one */
+ parser = gda_sql_parser_new ();
+ }
+
+ sql = g_strdup_printf ("SELECT * FROM %s", table->name);
+ stmt = gda_sql_parser_parse_string (parser, sql, NULL, NULL);
+ g_free (sql);
+ dm = gda_connection_statement_execute_select (gda_conn_ref_db, stmt, NULL, &error);
+ g_object_unref (stmt);
+ if (dm != NULL)
+ {
+ read_fields_explicit (table, op, dm);
+ }
+ }
}
g_object_unref (mstruct);
}
Table *table;
GdaServerOperation *op;
- GdaColumn *gda_column;
- GdaMetaTableColumn *mt_column;
g_printf ("* Reading tables on reference database declared on command line.\n");
}
}
- for (col = 0; col < cols; col++)
- {
- gda_column = gda_data_model_describe_column (dm, col);
-
- mt_column = g_new0 (GdaMetaTableColumn, 1);
- mt_column->column_name = g_strdup (gda_column_get_name (gda_column));
- mt_column->column_type = g_strdup (gda_column_get_dbms_type (gda_column));
- mt_column->gtype = gda_column_get_g_type (gda_column);
- /*mt_column->pkey = gda_column_get_*/
- mt_column->nullok = gda_column_get_allow_null (gda_column);
- mt_column->default_value = gda_value_stringify (gda_column_get_default_value (gda_column));
- table->fields = g_slist_append (table->fields, mt_column);
-
- if (verbose)
- {
- g_printf ("\t\tField: %s - %s - %d - %d - %d - %s\n",
- mt_column->column_name,
- mt_column->column_type,
- mt_column->gtype,
- mt_column->pkey,
- mt_column->nullok,
- mt_column->default_value);
- }
-
- field_server_operation (table, op, mt_column, col);
- }
+ read_fields_explicit (table, op, dm);
if (cols > 0)
{
tables = g_slist_append (tables, table);
}
}
+ else
+ {
+ g_printf ("* No table on reference database.\n");
+ read_tables_explicit ();
+ }
+
if (dm_tables != NULL)
{
g_object_unref (dm_tables);
read_tables ();
g_printf ("* Copying data.\n");
- copy_data ();
+ //copy_data ();
g_printf ("* Reading views.\n");
- read_views ();
+ //read_views ();
if (output_file != NULL)
{