update_meta_store
Description:
Updates this's associated MetaStore.
If context
is not null
, then only the parts described by context
will be updated, and if it is
null
, then the complete meta store will be updated. Detailed explanations follow:
In order to keep the meta store's contents in a consistent state, the update process involves updating the contents of all the tables related to one where the contents change. For example the "_columns" table (which lists all the columns of a table) depends on the "_tables" table (which lists all the tables in a schema), so if a row is added, removed or modified in the "_tables", then the "_columns" table's contents needs to be updated as well regarding that row.
If context
is null
, then the update process will simply overwrite any data that was present in all the meta store's
tables with new (up to date) data even if nothing has changed, without having to build the tables' dependency tree. This is the recommended way
of proceeding when dealing with a meta store which might be outdated.
On the other hand, if context
is not null
, then a tree of the dependencies has to be built (depending on
context
) and only some parts of the meta store are updated following that dependencies tree. Specifying a context may be useful for
example in the following situations:
- One knows that a database object has changed (for example a table created), and may use the
context
to request that only the information about that table be updated - One is only interested in the list of views, and may request that only the information about views may be updated
When context
is not null
, and contains specified SQL identifiers (for example the "table_name" of the "_tables"
table), then each SQL identifier has to match the convention the MetaStore has
adopted regarding case sensitivity, using quote_sql_identifier
or sql_identifier_quote.
see the meta data section about SQL identifiers for more information, and the documentation about the sql_identifier_quote function which will be most useful.
Note however that usually more
information will be updated than strictly requested by the context
argument.
For more information, see the Database structure section, and the Update the meta data about a table howto.
Parameters:
this |
a Connection object. |
context |
description of which part of this's associated
MetaStore should be updated, or |
Returns:
TRUE if no error occurred |