You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an upcoming version of SDV, we will be consolidating the Multi and Single table metadata objects into a streamlined Metadata object. Effectively, this object is the same as multi-table, so it includes functions that are suited for detecting multiple tables at once.
However, if you have a single table, it should still be usable without adding much friction. Currently, there is a SingleTableMetadata.detect_from_ddl function that has not been added to the consolidated Metadata object.
Expected behavior
Add a detect_from_ddl function to the Metadata object. This will work similarly to the existing function, but with slight modifications to work for both the single and multi-table cases.
To improve the usage of this function, we will make it a class function that ultimately returns an instance of the metadata object.
(required) filepath: The location of the DDL file that contains the schema
(required) db_type: A string with the type of SQL variant. Currently only 'ibm_db2' is supported
table_names: A list of strings representing the table names to extract. For a single table, supply a list of 1 element.
(default) Consider all tables in the database
database_name: A string with the name of the database. In the DDL file, the database name is usually prepended to the table, such as users.transaction_log
(default) None: Don't consider any specific database
Functionality: Detect metadata for all the tables that the user has specified. If there is only 1 table specified, then only 1 table's information will be in the metadata. If there are multiple tables specified, then they will all be included in the metadata including any primary/foreign key relationships that we find between them.
Output: An instance of the metadata object with the detected metadata
The text was updated successfully, but these errors were encountered:
Problem Description
In an upcoming version of SDV, we will be consolidating the Multi and Single table metadata objects into a streamlined Metadata object. Effectively, this object is the same as multi-table, so it includes functions that are suited for detecting multiple tables at once.
However, if you have a single table, it should still be usable without adding much friction. Currently, there is a
SingleTableMetadata.detect_from_ddl
function that has not been added to the consolidatedMetadata
object.Expected behavior
Add a
detect_from_ddl
function to theMetadata
object. This will work similarly to the existing function, but with slight modifications to work for both the single and multi-table cases.To improve the usage of this function, we will make it a class function that ultimately returns an instance of the metadata object.
Parameters:
filepath
: The location of the DDL file that contains the schemadb_type
: A string with the type of SQL variant. Currently only 'ibm_db2' is supportedtable_names
: A list of strings representing the table names to extract. For a single table, supply a list of 1 element.database_name
: A string with the name of the database. In the DDL file, the database name is usually prepended to the table, such asusers.transaction_log
Functionality: Detect metadata for all the tables that the user has specified. If there is only 1 table specified, then only 1 table's information will be in the metadata. If there are multiple tables specified, then they will all be included in the metadata including any primary/foreign key relationships that we find between them.
Output: An instance of the metadata object with the detected metadata
The text was updated successfully, but these errors were encountered: