Dynamic Metadata

    Dynamic metadata is metadata extracted from a result of an SQL query.

    Remember that dynamic metadata is generated dynamically at runtime only. As a result, its fields cannot be viewed or modified in metadata editor in CloverDX Designer.

    To define the dynamic metadata, open the Source tab and type in the following lines:

    <Metadata id="YourMetadataId"

    To read unknown database data types as strings, set unknownJdbcTypesAsString to true. If the attribute value is set to false, the conversion from the unknown type fails.

    You can add the sqlOptimization="true" attribute to speed up metadata extraction process.

    Specify a unique expression for YourMetadataId (e.g. DynamicMetadata1) and an ID of a previously created DB connection that should be used to connect to DB as YourConnectionToDB. Type the query that will be used to extract metadata from DB as YourQuery (e.g. select * from myTable).

    Example 32.3. 

    <Metadata connection="JDBC0" id="DynamicMetadata0" name="users"
                sqlQuery="SELECT * FROM users LIMIT 1"/>

    In order to speed up the metadata extraction, add the clause "where 1=0" or "and 1=0" to the query. The former one should be added to a query with no where condition and the latter clause should be added to the query which already contains "where ..." expression. This way, only metadata are extracted and no data will be read.


    It is highly recommended you skip the checkConfig method whenever dynamic metadata is used. To do that, tick the Skip checkConfig checkbox in the Run Configuration dialog. See Run Configuration.