Commit f9436019 authored by Vivien Malerba's avatar Vivien Malerba

Added new DDL operations, rewrote the way GdaDict handles types, functions,...

Added new DDL operations, rewrote the way GdaDict handles types, functions, aggregates and queries in a generic way, and lots of minor improvements and big fixes
parent ab05c8ac
2006-08-28 Vivien Malerba <malerba@gnome-db.org>
* providers/sqlite/gda-sqlite-provider.c:
* providers/mysql/gda-mysql-provider.c:
* providers/postgres/gda-postgres-provider.c: accept "DATABASE" instead of "DB_NAME"
and "URI" instead of "DB_DIR" and "DB_NAME" in connection strings, and show a warning
* libgda/gda-threader.c: use a timeout instead of an idle function for shorter
notification time
* libgda/gda-server-operation.[ch]:
* providers/sqlite:
* providers/mysql:
* providers/postgres: Added support to rename a table and add a column to a table
* libgda/gda-dict.[ch]: replaced the "*_added", "*_removed" and "*_updated" signals
with "object_added", "object_removed" and "object_updated" signals (impacts other
files as well).
* libgda/gda-dict-private.h:
* libgda/gda-dict-reg-*.[ch]:
* libgda/gda-dict.[ch]: make that object reference types, functions, aggregates
and queries in a generic way to reduce code and enable future extensions
without API/ABI breakage
* libgda/gda-dict-database.[ch]: code cleanups
* libgda/gda-dict.c:
* libgda/gda-dict-database.c: allow to update only some kind of meta-data
with the DBMS
* other files: changes required by the above changes, and minor bug fixes.
2006-08-20 Vivien Malerba <malerba@gnome-db.org>
* providers/sqlite/*.xml.in: new files for server operation
......
......@@ -79,6 +79,7 @@
<!ENTITY libgda-report-result SYSTEM "xml/gda-report-result.xml">
<!ENTITY libgda-report-valid SYSTEM "xml/gda-report-valid.xml">
<!ENTITY libgda-GdaDict SYSTEM "xml/gda-dict.xml">
<!ENTITY libgda-GdaDictExtend SYSTEM "xml/gda-dict-extend.xml">
<!ENTITY libgda-GdaConnection SYSTEM "xml/gda-connection.xml">
<!ENTITY libgda-GdaObject SYSTEM "xml/gda-object.xml">
<!ENTITY libgda-GdaXmlStorage SYSTEM "xml/gda-xml-storage.xml">
......@@ -420,6 +421,7 @@
&libgda-GdaDictTable;
&libgda-GdaDictField;
&libgda-GdaDictConstraint;
&libgda-GdaDictExtend;
</chapter>
<chapter>
......
......@@ -739,64 +739,6 @@ GDA_TYPE_SERVER_PROVIDER
gda_server_provider_get_type
</SECTION>
<SECTION>
<FILE>gda-enum-types</FILE>
<TITLE></TITLE>
<SUBSECTION Standard>
GDA_TYPE_BLOB_MODE
GDA_TYPE_CLIENT_EVENT
GDA_TYPE_CLIENT_SPECS_TYPE
GDA_TYPE_COMMAND_OPTIONS
GDA_TYPE_COMMAND_TYPE
GDA_TYPE_CONNECTION_EVENT_CODE
GDA_TYPE_CONNECTION_EVENT_TYPE
GDA_TYPE_CONNECTION_FEATURE
GDA_TYPE_CONNECTION_OPTIONS
GDA_TYPE_CONNECTION_SCHEMA
GDA_TYPE_DICT_CONSTRAINT_FK_ACTION
GDA_TYPE_DICT_CONSTRAINT_TYPE
GDA_TYPE_DICT_FIELD_ATTRIBUTE
GDA_TYPE_ENTITY_FIELD_STATE
GDA_TYPE_GRAPH_TYPE
GDA_TYPE_OBJECT_REF_TYPE
GDA_TYPE_PARAMETER_LIST_PARAM_HINT
GDA_TYPE_QUERY_CONDITION_OPERATOR
GDA_TYPE_QUERY_CONDITION_TYPE
GDA_TYPE_QUERY_JOIN_TYPE
GDA_TYPE_QUERY_TARGET_TYPE
GDA_TYPE_QUERY_TYPE
GDA_TYPE_RENDERER_OPTIONS
GDA_TYPE_SORTING
GDA_TYPE_TRANSACTION_ISOLATION
GDA_TYPE_VALUE_ATTRIBUTE
GDA_TYPE_VALUE_TYPE
gda_blob_mode_get_type
gda_client_event_get_type
gda_client_specs_type_get_type
gda_sorting_get_type
gda_command_options_get_type
gda_command_type_get_type
gda_connection_event_type_get_type
gda_connection_event_code_get_type
gda_connection_options_get_type
gda_connection_feature_get_type
gda_connection_schema_get_type
gda_dict_constraint_type_get_type
gda_dict_constraint_fk_action_get_type
gda_dict_field_attribute_get_type
gda_graph_type_get_type
gda_entity_field_state_get_type
gda_object_ref_type_get_type
gda_parameter_list_param_hint_get_type
gda_query_condition_type_get_type
gda_query_condition_operator_get_type
gda_query_type_get_type
gda_query_join_type_get_type
gda_query_target_type_get_type
gda_renderer_options_get_type
gda_transaction_isolation_get_type
</SECTION>
<SECTION>
<FILE>gda-threader</FILE>
<TITLE>GdaThreader</TITLE>
......@@ -849,6 +791,7 @@ gda_server_provider_init_schema_model
<SECTION>
<FILE>gda-value</FILE>
<TITLE>Gda Value</TITLE>
GValueAttribute
GdaGeometricPoint
GdaNumeric
GdaTime
......@@ -949,25 +892,12 @@ gda_object_get_type
<TITLE>GdaDict</TITLE>
GdaDict
gda_dict_new
gda_dict_load_xml_file
gda_dict_save_xml_file
gda_dict_get_handler
gda_dict_get_default_handler
gda_dict_declare_query
gda_dict_assume_query
gda_dict_unassume_query
gda_dict_get_queries
gda_dict_get_query_by_xml_id
gda_dict_declare_graph
gda_dict_assume_graph
gda_dict_unassume_graph
gda_dict_get_graphs
gda_dict_get_graph_by_xml_id
gda_dict_get_graph_for_object
gda_dict_get_connection
gda_dict_extend_with_functions
gda_dict_set_connection
gda_dict_get_connection
gda_dict_get_database
gda_dict_dump
gda_dict_declare_object_string_id_change
gda_dict_get_object_by_string_id
gda_dict_update_dbms_data
gda_dict_stop_update_dbms_data
gda_dict_compute_xml_filename
......@@ -975,23 +905,31 @@ gda_dict_set_xml_filename
gda_dict_get_xml_filename
gda_dict_load
gda_dict_save
gda_dict_get_entities_fk_constraints
gda_dict_load_xml_file
gda_dict_save_xml_file
gda_dict_get_handler
gda_dict_get_default_handler
gda_dict_get_queries
gda_dict_get_query_by_xml_id
gda_dict_get_dict_types
gda_dict_get_dict_type_by_name
gda_connection_add_data_type
gda_dict_get_dict_type_by_xml_id
gda_dict_declare_custom_data_type
gda_dict_get_functions
gda_dict_get_functions_by_name
gda_dict_get_function_by_name_arg
gda_dict_get_function_by_dbms_id
gda_dict_get_function_by_xml_id
gda_dict_get_function_by_dbms_id
gda_dict_get_aggregates
gda_dict_get_aggregates_by_name
gda_dict_get_aggregate_by_name_arg_real
gda_dict_get_aggregate_by_name_arg
gda_dict_get_aggregate_by_dbms_id
gda_dict_get_aggregate_by_xml_id
gda_dict_get_aggregate_by_dbms_id
gda_dict_declare_object
gda_dict_assume_object
gda_dict_unassume_object
gda_dict_get_objects
gda_dict_get_object_by_name
gda_dict_get_object_by_xml_id
<SUBSECTION Standard>
GDA_DICT
GDA_DICT_CLASS
......@@ -1000,6 +938,22 @@ GDA_TYPE_DICT
gda_dict_get_type
</SECTION>
<SECTION>
<FILE>gda-dict-extend</FILE>
<TITLE>GdaDictExtend</TITLE>
GdaDictRegisterStruct
GdaDictRegFreeFunc
GdaDictRegSyncFunc
GdaDictRegGetListFunc
GdaDictRegSaveFunc
GdaDictRegLoadFunc
GdaDictGetObjFunc
gda_dict_class_always_register
gda_dict_register_object_type
gda_dict_get_object_type_registration
</SECTION>
<SECTION>
<FILE>gda-dict-field</FILE>
<TITLE>GdaDictField</TITLE>
......@@ -1067,6 +1021,7 @@ gda_graph_query_get_type
<FILE>gda-graph</FILE>
<TITLE>GdaGraph</TITLE>
GdaGraph
GdaGraphType
gda_graph_new
gda_graph_get_graph_type
gda_graph_get_items
......@@ -1222,6 +1177,7 @@ gda_object_ref_set_ref_object_type
gda_object_ref_set_ref_object
gda_object_ref_replace_ref_object
gda_object_ref_get_ref_name
gda_object_ref_get_ref_object_name
gda_object_ref_get_ref_type
gda_object_ref_get_ref_object
gda_object_ref_activate
......@@ -1249,11 +1205,6 @@ gda_dict_database_get_table_by_name
gda_dict_database_get_table_by_xml_id
gda_dict_database_get_field_by_name
gda_dict_database_get_field_by_xml_id
gda_dict_database_get_sequence_by_name
gda_dict_database_get_sequence_by_xml_id
gda_dict_database_get_sequence_to_field
gda_dict_database_link_sequence
gda_dict_database_unlink_sequence
gda_dict_database_get_all_constraints
gda_dict_database_get_table_constraints
gda_dict_database_get_all_fk_constraints
......@@ -1530,6 +1481,7 @@ gda_referer_get_type
<FILE>gda-query-field</FILE>
<TITLE>GdaQueryField</TITLE>
GdaQueryField
GdaQueryFieldState
gda_query_field_new_from_xml
gda_query_field_new_copy
gda_query_field_new_from_sql
......
......@@ -86,48 +86,6 @@ with objects such as #GdaDictTable (composed of #GdaDictfield objects) and #GdaD
@dbdatabase: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDictDatabase::fs-link-added ##### -->
<para>
</para>
@dbdatabase: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GdaDictDatabase::fs-link-removed ##### -->
<para>
</para>
@dbdatabase: the object which received the signal.
@arg1:
@arg2:
<!-- ##### SIGNAL GdaDictDatabase::sequence-added ##### -->
<para>
</para>
@dbdatabase: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDictDatabase::sequence-removed ##### -->
<para>
</para>
@dbdatabase: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDictDatabase::sequence-updated ##### -->
<para>
</para>
@dbdatabase: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDictDatabase::table-added ##### -->
<para>
......@@ -200,8 +158,8 @@ with objects such as #GdaDictTable (composed of #GdaDictfield objects) and #GdaD
</para>
@db:
@flags:
@obj_name:
@limit_to_type:
@limit_obj_name:
@error:
@Returns:
......@@ -263,56 +221,6 @@ with objects such as #GdaDictTable (composed of #GdaDictfield objects) and #GdaD
@Returns:
<!-- ##### FUNCTION gda_dict_database_get_sequence_by_name ##### -->
<para>
</para>
@db:
@name:
@Returns:
<!-- ##### FUNCTION gda_dict_database_get_sequence_by_xml_id ##### -->
<para>
</para>
@db:
@xml_id:
@Returns:
<!-- ##### FUNCTION gda_dict_database_get_sequence_to_field ##### -->
<para>
</para>
@db:
@field:
@Returns:
<!-- ##### FUNCTION gda_dict_database_link_sequence ##### -->
<para>
</para>
@db:
@seq:
@field:
<!-- ##### FUNCTION gda_dict_database_unlink_sequence ##### -->
<para>
</para>
@db:
@seq:
@field:
<!-- ##### FUNCTION gda_dict_database_get_all_constraints ##### -->
<para>
......
......@@ -45,30 +45,6 @@ object for more information.
</para>
<!-- ##### SIGNAL GdaDict::aggregate-added ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::aggregate-removed ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::aggregate-updated ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::changed ##### -->
<para>
......@@ -76,30 +52,6 @@ object for more information.
@dbdict: the object which received the signal.
<!-- ##### SIGNAL GdaDict::data-type-added ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::data-type-removed ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::data-type-updated ##### -->
<para>
</para>
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::data-update-finished ##### -->
<para>
......@@ -114,7 +66,7 @@ object for more information.
@gdadict: the object which received the signal.
<!-- ##### SIGNAL GdaDict::function-added ##### -->
<!-- ##### SIGNAL GdaDict::object-act-changed ##### -->
<para>
</para>
......@@ -122,7 +74,7 @@ object for more information.
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::function-removed ##### -->
<!-- ##### SIGNAL GdaDict::object-added ##### -->
<para>
</para>
......@@ -130,7 +82,7 @@ object for more information.
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::function-updated ##### -->
<!-- ##### SIGNAL GdaDict::object-removed ##### -->
<para>
</para>
......@@ -138,52 +90,12 @@ object for more information.
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::graph-added ##### -->
<!-- ##### SIGNAL GdaDict::object-updated ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::graph-removed ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::graph-updated ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::query-added ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::query-removed ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::query-updated ##### -->
<para>
</para>
@dbdict: the object which received the signal.
@gdadict: the object which received the signal.
@arg1:
<!-- ##### SIGNAL GdaDict::update-progress ##### -->
......@@ -201,26 +113,11 @@ object for more information.
</para>
<!-- ##### ARG GdaDict:graph-serial ##### -->
<para>
</para>
<!-- ##### ARG GdaDict:query-serial ##### -->
<para>
</para>
<!-- ##### ARG GdaDict:username ##### -->
<para>
</para>
<!-- ##### ARG GdaDict:with-functions ##### -->
<para>
</para>
<!-- ##### FUNCTION gda_dict_new ##### -->
<para>
......@@ -229,226 +126,193 @@ object for more information.
@Returns:
<!-- ##### FUNCTION gda_dict_load_xml_file ##### -->
<!-- ##### FUNCTION gda_dict_extend_with_functions ##### -->
<para>
</para>
@dict:
@xmlfile:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_save_xml_file ##### -->
<!-- ##### FUNCTION gda_dict_set_connection ##### -->
<para>
</para>
@dict:
@xmlfile:
@error:
@Returns:
@cnc:
<!-- ##### FUNCTION gda_dict_get_handler ##### -->
<!-- ##### FUNCTION gda_dict_get_connection ##### -->
<para>
</para>
@dict:
@for_type:
@Returns:
<!-- ##### FUNCTION gda_dict_get_default_handler ##### -->
<!-- ##### FUNCTION gda_dict_get_database ##### -->
<para>
</para>
@dict:
@for_type:
@Returns:
<!-- ##### FUNCTION gda_dict_declare_query ##### -->
<!-- ##### FUNCTION gda_dict_declare_object_string_id_change ##### -->
<para>
</para>
@dict:
@query:
<!-- ##### FUNCTION gda_dict_assume_query ##### -->
<para>
</para>
@dict:
@query:
<!-- ##### FUNCTION gda_dict_unassume_query ##### -->
<para>
</para>
@dict:
@query:
@obj:
@oldid:
<!-- ##### FUNCTION gda_dict_get_queries ##### -->
<!-- ##### FUNCTION gda_dict_get_object_by_string_id ##### -->
<para>
</para>
@dict:
@strid:
@Returns:
<!-- ##### FUNCTION gda_dict_get_query_by_xml_id ##### -->
<!-- ##### FUNCTION gda_dict_update_dbms_data ##### -->
<para>
</para>
@dict:
@xml_id:
@limit_to_type:
@limit_obj_name:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_declare_graph ##### -->
<!-- ##### FUNCTION gda_dict_stop_update_dbms_data ##### -->
<para>
</para>
@dict:
@graph:
<!-- ##### FUNCTION gda_dict_assume_graph ##### -->
<!-- ##### FUNCTION gda_dict_compute_xml_filename ##### -->
<para>
</para>
@dict:
@graph:
@datasource:
@app_id:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_unassume_graph ##### -->
<!-- ##### FUNCTION gda_dict_set_xml_filename ##### -->
<para>
</para>
@dict:
@graph:
@xmlfile:
<!-- ##### FUNCTION gda_dict_get_graphs ##### -->
<!-- ##### FUNCTION gda_dict_get_xml_filename ##### -->
<para>
</para>
@dict:
@type_of_graphs:
@Returns:
<!-- ##### FUNCTION gda_dict_get_graph_by_xml_id ##### -->
<!-- ##### FUNCTION gda_dict_load ##### -->
<para>
</para>
@dict:
@xml_id:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_get_graph_for_object ##### -->
<!-- ##### FUNCTION gda_dict_save ##### -->
<para>
</para>
@dict:
@obj:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_get_connection ##### -->
<!-- ##### FUNCTION gda_dict_load_xml_file ##### -->
<para>
</para>
@dict:
@xmlfile:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_set_connection ##### -->
<para>
</para>
@dict:
@cnc:
<!-- ##### FUNCTION gda_dict_get_database ##### -->
<!-- ##### FUNCTION gda_dict_save_xml_file ##### -->
<para>
</para>
@dict:
@xmlfile:
@error:
@Returns:
<!-- ##### FUNCTION gda_dict_dump ##### -->
<para>
</para>
@dict:
<!-- ##### FUNCTION gda_dict_update_dbms_data ##### -->
<!-- ##### FUNCTION gda_dict_get_handler ##### -->
<para>
</para>
@dict:
@error:
@for_type:
@Returns: